When a user presses the back button on an intent, the application should quit. How can I ensure the application quits when the back button is pressed?
finish your current_activity using method finish() onBack method of your current_activity
finish() onBack method of your current_activity
and then add below lines in onDestroy of the current_activity for Removing Force close
@Override public void onDestroy() { android.os.Process.killProcess(android.os.Process.myPid()); super.onDestroy(); }