1

I got an imageView in First activity and I want to pass over the string to the 2nd activity in order to display the same image.

I got this code in first activity:

ImageView imageView = (ImageView)findViewById(R.id.imageView1);    
String sharePre = imageView.getDrawable().toString();

As a result, I got String sharePre = android.graphics.drawable.BitmapDrawable@42a74470

Problem: How can I convert the String back to Drawable in 2nd activity, in other word, I want to use

ImageView imageView2 = (ImageView)findViewById(R.id.imageView2); imageView2.setImageDrawable(sharePre.toDrawrable);

Ricky Zheng
  • 1,279
  • 3
  • 16
  • 27

0 Answers0