我在第一個活動中得到了一個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獲取圖像 –