个人
sxxnjit
这个作者很懒,什么都没留下…
展开
-
Android 多应用读SharedPreferences时的脏读问题
A应用写入设置,B应用读取设置。 当B应用第一次读取到A应用设置的值后,A应用又一次写入新的值后,B应用再一次读取设置是,可能出现读取到的值是旧数据。 解决方法:getSharedPreferences时MODE中不要忘了添加Context.MODE_MULTI_PROCESS。 /** * SharedPreference loading flag: when set,原创 2012-08-18 14:34:32 · 1057 阅读 · 0 评论 -
How to get byte array from imageview
ImageView iv = (ImageView) findViewById(R.id.splashImageView); Drawable d =iv.getBackground(); BitmapDrawable bitDw = ((BitmapDrawable) d); Bitmap bitmap = bitDw.getBitmap(); System.ou转载 2012-08-02 14:08:14 · 373 阅读 · 0 评论 -
Android Studio 使用 lombok
1.下载安装lombok plugin插件 如图 2.build.gradle文件中添加依赖 compile 'javax.annotation:javax.annotation-api:1.2' compile 'org.projectlombok:lombok:1.16.6' 3.在model类中使用@Data 如图,get、set、equals、hashCod原创 2016-03-03 16:42:19 · 5539 阅读 · 0 评论