How to close Android application when back button clicked?

The question and the answer is easy. Catch the back button and write finish() to close the application. But it may not work in some cases.
I faced with one of this cases and found a different approach. To use onBackPressed method you have to use Android 2.2 and higher. Hope this also helps to you.

Leave a Reply

*

This blog is kept spam free by WP-SpamFree.