I am developing one application. In that application I want to put Exit button. By clicking Exit Button I want to exit from application.
I used the following code:
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish();
It exit the application but not stop all activities which are running in that application.
Please give me some suggestion to solve this problem.