0

I want to save my current ImageView image to Drawable and later on retrieve that image from the Drawable and render it to ImageView. Has anyone faced a similar problem?

This is my code so far to retrieve the image from Drawable but it's not working...

Drawable d = this.getResources().getDrawable(R.drawable.icon);
mImageView.setImageURI(Uri.parse(d));
  • Welcome to Stack Overflow! I've edited your question a bit. You write that "it's not working", could you [edit] your question to tell us what happens when you try this? If there is anything interesting in the LogCat, then please add that as well. BTW, asking if people have experienced the same makes it sound a bit like a poll; you may want to avoid that phrase on Stack Overflow, as asking for opinions/polling is off-topic here. Good luck, hope you'll get an answer! – S.L. Barth is on codidact.com Mar 28 '16 at 17:21

1 Answers1

0

You are trying to set image by URI. Use this instead:

mImageView.setImageDrawable(d);
Onur Çevik
  • 1,560
  • 13
  • 21