android监听返回键
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
return true;
}
return super.onKeyDown(keyCode, event);
}
event.getRepeatCount() == 0重复次数:1次
时间: 2024-10-25 17:09:52