Skip to content Skip to sidebar Skip to footer

My Android App's Singleton Gets Re-initialized While App Is Running

I searched for 2-3 days a solution to my problem, but i haven't found anyone who had a similar problem. Basically, my app is the 'mobile version' of a web site, so I have to store

Solution 1:

I guess you want to have some "session" user.

I don't know the exact issue, but afaik the Android system may destroy static data when it is low in memory.

What you could do is store some values (user, timestamp) as Preference-values or as persistent data (file, db). Another way is of course to pass the required user data from one activity to another.

Post a Comment for "My Android App's Singleton Gets Re-initialized While App Is Running"