I'm trying to test how my application handles getting destroyed by the Android ActivityManager
(and later restarted by Alarm events).
In other words, I want to force the message:
I/ActivityManager( 333): No longer want com.myname.myapp (pid 4444): hidden #22
Is there a way to reliably induce the ActivityManager
to "No longer want" my application?
A few tricks I know for ending processes (however, the purpose of this question is to find something to induce the ActivityManager
method of "No longer want").
ActivityManager
"No longer want" method.ActivityManager
.killBackgroundProcesses()
. killBackgroundProcesses()
explicitly would behave exactly the same as the ActivityManager
"No longer want" method.In the newer version of Android there is a option of "Don't keep activities". After selecting that every activity gets destroyed as soon as the user leaves the Activity. For example we have activity A and B. Normal Flow
After selecting Don't keep activities
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With