我在第一个活动中得到了一个imageView,我想将字符串传递给第二个活动以显示相同的图像。如何将字符串转换为android中的imageView drawable在android
我得到这个代码的第一个活动:
ImageView imageView = (ImageView)findViewById(R.id.imageView1);
String sharePre = imageView.getDrawable().toString();
其结果是,我得到了String sharePre = [email protected]
问题:我如何转换的字符串返回在第二活动绘制的,换句话说,我要使用
ImageView imageView2 = (ImageView)findViewById(R.id.imageView2); imageView2.setImageDrawable(sharePre.toDrawrable);
你是如何设置IM第一个Activity中的'imageView'的年龄是多少? –
我宁愿将图像的URI转换为字符串并将其发送给另一个活动,其他活动从URI获取图像 –