大家都应该知道微信可以自由设置聊天的背景图片。现在我做一个试验,两个Activity,activity1和activity2.activity1用于让用户随即的更改activity2的背景图片(从相册选)。这个怎么实现啊。要退出之后再进去activity2的背景图片还是用户选的那个。
解决方案 »
- android如何实现大文件下载(只能通过80端口,服务器端用asp.net)
- 问个关于animation的问题
- 请问如何实现背景不动,上层OnDraw()出来的表格滑动的效果?
- 在eclipse中怎么总是启动前一个运行过的项目
- 请问android如何访问远程数据库?
- MediaStore.Audio.Media.IS_PODCAST
- 问下adb命令配置环境变量的事情
- 安卓GridView
- eclipse开发百度地图出现so文件报错,请各位看下!
- Android开发工具Eclipse的暗转问题
- 关于Android实时视频编解码方案选择的问题/h263?h264?
- 真机上is waiting the debugger to attach问题请教
settings = getSharedPreferences("appSetting", MODE_PRIVATE);
layoutInflater = LayoutInflater.from(this);
String tempSet = settings.getString("colorSet", "false");
if(!"false".equals(tempSet)){
View setView = layoutInflater.inflate(R.layout.set, null);
String pathTemp = getPath(tempSet);
ImageView imgSet = (ImageView) setView.findViewById(R.id.set_img);
LinearLayout linerSet = (LinearLayout) setView.findViewById(R.id.set_liner);
Bitmap bm = BitmapFactory.decodeFile(pathTemp);
Log.e("path", pathTemp);
Drawable dr = new BitmapDrawable(null, bm);
linerSet.setBackgroundDrawable(dr);
imgSet.setImageBitmap(bm);
///linerSet.setBackgroundColor(Color.YELLOW); ///////①
}我这么写怎么没有反应呢?①是用来测试的。我在if里面只给linerSet给一个Yellow的背景色,也是有的时候可以有的时候不行啊。。为什么啊?