I'm currently getting into android development. I try to let the user end the application by a menu button. This is my attempt:
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_exit) {
android.os.Process.killProcess(android.os.Process.myPid());
super.onDestroy();
}
return super.onOptionsItemSelected(item);
}
The application window closes, but when I switch to the "open applications window" it is still there. How can I end/kill/close/shutdown my application completely?