- @Override
- public void onAttachedToWindow() {
- // TODO Auto-generated method stub
- this .getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
- super.onAttachedToWindow();
- }
- @Override
- public boolean onKeyDown( int keyCode, KeyEvent event ) {
- // TODO Auto-generated method stub
- switch (keyCode) {
- case KeyEvent.KEYCODE_BACK:
- Log.e("Test" , "onKeyDown KEYCODE_BACK" );
- break ;
- case KeyEvent.KEYCODE_HOME:
- Log.e("Test" , "onKeyDown KEYCODE_HOME" );
- break ;
- }
- return false ;
- }
android控制home键 代码
最新推荐文章于 2024-05-23 10:52:02 发布