I have a Fragment Activity
hosting a Map
and ListActivity
. I wanna put a method when the back button is pressed on the Activity
, but it seems it doesn't work at all. My Log
isn't even printed on the Stacktrace
.
I have no idea what's wrong actually.
Here's the method:
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK ) {
Log.e("Test","Back Button Clicked");
this.finish();
return true;
}
return super.onKeyDown(keyCode, event);
}