android按键 禁用

public boolean onKeyDown(int keyCode, KeyEvent event) {

if (keyCode == KEYCODE_BARCODE_ENTER) {
} else if (keyCode == KEYCODE_VOLUME_UP) {
} else if (keyCode == KEYCODE_VOLUME_DOWN) {
} else if (keyCode == KeyEvent.KEYCODE_MENU) {
return true;
} else if (keyCode == KeyEvent.KEYCODE_BACK) {
return true;
} else if (keyCode == KeyEvent.KEYCODE_HOME) {
return true;
}
return super.onKeyDown(keyCode, event);
}

你可能感兴趣的:(android)