1、方法一
@Override
public boolean onKeyDown(intkeyCode, KeyEventevent) {
if(keyCode == KeyEvent.KEYCODE_BACK &&event.getRepeatCount() ==0)
{//TODO something
return true; }
return super.onKeyDown(keyCode,event); }
2、方法二
@Override public void onBackPressed() {
//TODO something super.onBackPressed();
}
网友评论