I have an app with a background process running with a notification image on top of it. I want to close the app by clicking a button inside of the App. Currently I have to force close it from the settings. What do I have to change in the code bellow to achieve this?
1:
Intent homeIntent = new Intent(Intent.ACTION_MAIN);
homeIntent.addCategory( Intent.CATEGORY_HOME );
homeIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(homeIntent);
2:finish();
3:System.exit(0);
The three codes above closes the app but the background process with the notication image is still running.