复制代码 代码如下:
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (event.getAction() == KeyEvent.ACTION_DOWN
&& event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
return true;//消费掉后退键
}
return super.onKeyDown(keyCode, event);
}