Override home button in android/ Disable home button in android/Stay on your activity while clicking home button in android
@Override public void onAttachedToWindow(){ Log.i("TESTE", "onAttachedToWindow"); this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD); super.onAttachedToWindow(); } public boolean onKeyDown(int keyCode, KeyEvent event){ if (keyCode == KeyEvent.KEYCODE_HOME) { Log.i("TESTE", "BOTAO HOME"); return true; } return super.onKeyDown(keyCode, event); } |
Comments
Post a Comment