I have an Android app that logs in to a server, gets a session ID and uses it for as long as the app is running. The session ID is stored in the SharedPeferences
.
For some reason, on one device (an old Samsung Galaxy S), sometimes when the application wakes up, the session ID is gone - it can't be retrieved from the SharedPreferences, and instead - null is returned. This happens probably after some heavy use of the phone, requiring Android to free up memory resources. Note that the application is still alive, it isn't restarted from scratch - my activity just gets onResume called.
I'd be really happy if I could reproduce this behavior on the emulator. Is there a way to nudge the emulator into doing the same thing?