Android Question Possible memory issue

gadgetmonster

Active Member
Licensed User
Longtime User
Hi

In my app I use the content chooser to allow the user to pick an image from the gallery but there seems to be a problem which may be down to memory. I have managed to replicate this issue on a sony xperia e1 and have had it reported also on a Samsung Galaxy s duo 2.

What seems to happen is when the user selects a photo and returns back to the app, activity_create is called with firsttime set to true.

I created a small test app which simply uses contentchooser to pick and then display a photo. Now, If I run some apps on my phone and then run my test app it has the same problem. Sometimes it works but sometimes it calls activity_create with firsttime = true.

My first thought was to persist my apps data by writing it to a file so that if I came back to my app and the activity had been destroyed, I could recover and show the data. However, I wouldn't know what image the user had selected as the activity had been re-started.

I have attached my test app in case I have done something wrong.

Anybody have any ideas?
 

Attachments

  • ContentChooser.zip
    399.6 KB · Views: 220

gadgetmonster

Active Member
Licensed User
Longtime User
Hi TDS,

The content chooser fires every time. A mate of mid vaguely remembers there being a flag you can set which tells the OS not to remove your process from memory and top remove others first. Don't remember seeing this but thought id ask incase someone is aware of it.

Not sure how to use getstartingintent. Tried having a look at what Activity.getstartingintent.action contained but it was blank.
 
Upvote 0
Top