i want to disable android device home button
when my app runs.
i have tried following code but it din't help :
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_HOME)) {
Toast.makeText(this, "You pressed the home button!",
Toast.LENGTH_LONG).show();
return false;
}
return super.onKeyDown(keyCode, event);
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
if (Intent.ACTION_MAIN.equals(intent.getAction())) {
Log.i("MyLauncher", "onNewIntent: HOME Key");
}
}