Dev b
Dev b

Reputation: 17

what is the best way to pass image from one activity another in android

In my apps, i need to pass image of image view from one activity to another. I know there are different kinds of way to pass image from activity to activity. But i want to know the best approach to do that. Previously i tried to pass image by getting the Bitmap of imageview from first activity then put in as putextra to the intent then extract the bitmap by getPercible to second activity. This was working good in Lollipop but getting error in Nougat. Now, i am trying to pass the bitmap as byteArray, but this is more unreliable than previous one. I don't know how to overcome this situation. Please help me in this context.

Upvotes: 0

Views: 72

Answers (1)

Rene Ferrari
Rene Ferrari

Reputation: 4216

Where do you get your image from?

I would advise you to store it locally and only pass the path to it to the other activity. In this activity just retrieve the Bitmap again from your local storage.

Upvotes: 1

Related Questions