Skip to content
Advertisement

Image Picked from Gallery ImageView Disappeard

I have a tabLayout with ImageView and when I Pick A image from the gallery and display it to Imageview then when I close the app the selected image is gone then I need to pick an image again.

And I know this one looks the same as my question but still not working saving image picked from gallery for future use

I tried this code but the image still disappeared https://github.com/martinsing/Image-Save-And-Retrieve-App

I also Read this other question but no one works Image in ImageView disappear

JavaScript

Advertisement

Answer

Do not use ACTION_PICK as then the obtained uri is not valid anymore after restart.

Instead use ACTION_OPEN_DOCUMENT and take persistable uri permissions in onActivityResult.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement