android return super.onKeyDown(keyCode, event);什么意思
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
switch (keyCode){
case KeyEvent.KEYCODE_BACK:
if(isExit){
return super.onKeyDown(keyCode, event);
}else {
Toast.makeText(this, "再按一下退出程序", Toast.LENGTH_SHORT).show();
isExit = true;
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(2000);
isExit = false;
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
return false;
}
default:
return super.onKeyDown(keyCode, event);
}
}
返回默认父类处理过程结果。
默认按照父类的处理来处理