Hi I am looking for disabling the Only HomeKey In Android. WHat i am trying to do is
@Override
public void onAttachedToWindow() {
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
super.onAttachedToWindow();
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
return true;
}
if (event.getKeyCode() == KeyEvent.KEYCODE_MENU) {
//action
}
if (event.getKeyCode() == KeyEvent.KEYCODE_HOME) {
//action
}
if (event.getKeyCode() == KeyEvent.KEYCODE_DPAD_CENTER) {
//action
}
return false;
}
But by this my back button is too getting disabled. Is there any way to just disable the HomeKey in android. Please reply.