大家都应该知道微信可以自由设置聊天的背景图片。现在我做一个试验,两个Activity,activity1和activity2.activity1用于让用户随即的更改activity2的背景图片(从相册选)。这个怎么实现啊。要退出之后再进去activity2的背景图片还是用户选的那个。
解决方案 »
- 调用so库中的函数出错
- android 以太网接口问题
- 在安卓程序中利用TTS引擎对文字进行语音播报,求解如何实现??
- android上进行图像处理(如锐化,调整对比度)最好使用哪个类
- 关于条形码扫描的问题?
- 急:安卓手机相同设备ID问题怎么解决?
- android调用webservice发送header身份验证不成功
- 不能创建对话框
- android编程中src根目录下的MainActivity不能自动生成
- 自学安卓困扰,刚开始就需要学fragment吗?
- 关于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的背景色,也是有的时候可以有的时候不行啊。。为什么啊?