I got a great tip from Mark Murphy @commonsguy on how to terminate Android app.
First – why do you need such awful thing? Here’s one scenario that I run into while trying to reproduce a bug reported by user
- Activity calls another application
- Original application terminates (basically I’m trying to simulate a very busy phone)
- 2nd app calls the original app
- Original app restarts from scratch and processes callback
So, how you do it? Very simple – just call
System.exit(0)
I’m going to run some tests but my hunch is the app just drops dead, so don’t expect gracious Activity#onStop or even Activity#onDestroy. Or at least that’s what I think, but for my purpose it’s all right
0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.