Take the 2-minute tour ×

How can I test whether my app behaves properly when Android OS kills its process due to low memory?

share|improve this question

3 Answers 3

Just press the home button, you will be able to use onPause and to save your state use: onSaveInstanceState(Bundle) / onCreate(Bundle) to handle recovery.

More on Activities and it's life-cycle: http://developer.android.com/reference/android/app/Activity.html

share|improve this answer

I guess you can't actually do anything if the OS terminates the process (this usually happens when your application is already paused or stopped).

See http://developer.android.com/guide/topics/fundamentals.html#actlife

share|improve this answer

I guess you don't need the answer anymore, but I was looking for the same thing: Test onCreate after the Activity was destroyed by the OS.

Here is the simple solution at least for the Emulator: Open the "Dev Tools" in the app drawer of your emulator, select "Development Setting*s" and activate the checkbox "*Immediately destroy activities"

After this, open your app and leave it via the Home key. Thats it.

share|improve this answer

Your Answer


