I am making a custom lock app and for that i need to disable the home button and notification bar so that the messages cannot be read/ apps cannot be accessed from the notification bar before the phone is unlocked.
I have disabled the home button using the following code:
@Override
public boolean onKeyDown(int keyCode, android.view.KeyEvent event) {
if((keyCode == KeyEvent.KEYCODE_HOME)){
return true;
}
return false;
}
public void onAttachedToWindow()// to disable Home button
{
// TODO Auto-generated method stub
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG|WindowManager.LayoutParams.FLAG_FULLSCREEN);
super.onAttachedToWindow();
}