In step A, try the following:
@Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0){ finish(); } return super.onKeyDown(keyCode, event); }
This should ensure that if you click the back button, the activity will be finish() ed. If this action is at the bottom of the stack, finish should exit the action.
Femi
source share