Kill the current activity, clear back stack, finish ----- Link: http://stackoverflow.com/questions/8631095/android-preventing-going-back-to-the-previous-activity ---- Font: https://stackoverflow.com/questions/5794506/android-clear-the-back-stack
// Kill current activity when press back button
@Override
public void onBackPressed() {
finish();
}
// Close current activity after load the one called.
Intent intent = new Intent(CharacterActivity.this, nextActivity.getClass());
startActivity(intent);
// Kill the current activity
finish();
// After Android 16 / Jellybean
// This command kill all activities
finishAffinity();