展会信息港展会大全

android开发屏蔽返回键和Home键
来源:互联网   发布日期:2016-01-19 12:22:10   浏览:2561次  

导读: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 ...

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);

}

//屏蔽home键的代码:

public void onAttachedToWindow()

{

this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);

super.onAttachedToWindow();

}

赞助本站

人工智能实验室
AiLab云推荐
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港