using for API level 5
@Override
public void onBackPressed() {
// your code.
}
and for older then API 5 use this:
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
// your code
return true;
}
return super.onKeyDown(keyCode, event);
}
沒有留言:
張貼留言