@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) { //監控/攔截/遮罩返回鍵
return true;
} else if (keyCode == KeyEvent.KEYCODE_MENU) {
//監控/攔截菜單鍵
} else if (keyCode == KeyEvent.KEYCODE_HOME) {
//由於Home鍵為系統鍵,此處不能捕獲,需要重寫onAttachedToWindow()
}
return super.onKeyDown(keyCode, event);
}
沒有留言:
張貼留言