I am sure this question has been asked number of times because I read a few. My client wants me to put a button into his app where users can click and exit. I have read this
Actually every one is looking for closing the application on an onclick event, wherever may be activity....
So guys friends try this code. Put this code on the onclick event
Intent homeIntent = new Intent(Intent.ACTION_MAIN);
homeIntent.addCategory( Intent.CATEGORY_HOME );
homeIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(homeIntent);