JPFrancoia
JPFrancoia

Reputation: 5629

image_picker and MainActivity destruction

I want to use the package image_picker in my application to allow my users to pick images from the phone's gallery. I'm concerned about this bit from the documentation:

When under high memory pressure the Android system may kill the MainActivity of the application using the image_picker. [...] This means that while the intent is executing the source application is moved to the background and becomes eligible for cleanup when the system is low on memory. When the intent finishes executing, Android will restart the application.

I understand what is supposed to happen, (un)fortunately my android phone has tons of RAM and I never manage to hit this edge case to reproduce the behaviour.

I would like to know precisely what would happen if the MainActivity was killed and if the application was "restarted". Does that mean that the application would be restarted from the very start, or would that mean that it would restart from the screen where the image picker was called?

I'm asking this because I'm calling the image picker from a route that is 4-5 screens away from the start screen, and I need the state of this particular screen to know what to do with the picked images. If the app is restarted on the very first screen and I call retrieveLostData, I'd get back the picked images but I'd be missing some data to know what to do with the images.

Upvotes: 0

Views: 77

Answers (0)

Related Questions