I want to block home button,back button and minimize button in navigation bar. Is it possible to block this button in android version 4.4.2?
Asked
Active
Viewed 555 times
-2
-
Clarify why you would want to block the keys though? How would a user get out of the app then, which is very poor UI concept. – t0mm13b May 20 '16 at 13:41
-
if you do this, then that could be a fishy application – RAAAAM May 20 '16 at 13:42
-
you can override onBackPressed of your activity to do nothing.. thats 'okay' but never disable other buttons.. here is how you can do it tho http://stackoverflow.com/questions/17549478/how-to-disable-home-and-other-system-buttons-in-android – Marko Niciforovic May 20 '16 at 13:44
2 Answers
0
Normally you're not supposed to block the usage of the Home button. Users should always be able to exit your app through the use of the home button. There is no api to disable this button.
1) If it is really necessary to block this button, you can make a custom OS with that functionality. There are most likely better solutions though.
2) You could register your app as a launcher app. This way you will know when the user presses the Home button and can act accordingly.
You can override the functionality of the back button.
Override onBackPressed
in your activity.
I don't know what you mean with the "minimize button".

miva2
- 2,111
- 25
- 34
-
I think my "minimize" he means the app menu button which is also can not be blocked. – DeeV May 20 '16 at 13:55
-
thanks for your replay and sorry for my bad communication bro.now i understood – Siddharthan May 21 '16 at 05:48
0
@Override
public void onBackPressed()
{
super.onBackPressed();
}
in this code remove super.onBackPressed(); line.
To remove back button.

jitesh
- 25
- 9