You can capture the key event and check the return key. About your activity:
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if(keyCode == KeyEvent.KEYCODE_BACK){
goBack();
return true;
}
return super.onKeyDown(keyCode, event);
}
And write a goBack method to go where you need to.
More: Android - onBackPressed () not working
source
share