Android屏蔽后退键的方法

1     public boolean onKeyDown(int keyCode, KeyEvent event) {
2         if (event.getAction() == KeyEvent.ACTION_DOWN
3                 && event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
4             return true;//消费掉后退键
5 
6         }
7         return super.onKeyDown(keyCode, event);
8     }

 

posted @ 2013-07-02 11:21  tagie  阅读(543)  评论(0编辑  收藏  举报