android屏蔽返回键和Home键
发布时间:2015-06-05 来源:查字典编辑
摘要://屏蔽返回键的代码:publicbooleanonKeyDown(intkeyCode,KeyEventevent){switch(key...
//屏蔽返回键的代码: public boolean onKeyDown(int keyCode,KeyEvent event) { switch(keyCode) { case KeyEvent.KEYCODE_HOME:return true; case KeyEvent.KEYCODE_BACK:return true; case KeyEvent.KEYCODE_CALL:return true; case KeyEvent.KEYCODE_SYM: return true; case KeyEvent.KEYCODE_VOLUME_DOWN: return true; case KeyEvent.KEYCODE_VOLUME_UP: return true; case KeyEvent.KEYCODE_STAR: return true; } return super.onKeyDown(keyCode, event); }