1

How can I disable the home, power and search buttons on Android 4.0+?

Michael Petrotta
  • 59,888
  • 27
  • 145
  • 179
  • 1
    I suspect that's impossible without system priviledges, which is probably a good thing. – John Carter Sep 26 '12 at 01:27
  • I may be partly wrong though: http://stackoverflow.com/questions/3898876/how-to-disable-the-home-key See also http://stackoverflow.com/questions/2162182/android-is-it-possible-to-disable-the-click-of-home-button?lq=1 – John Carter Sep 26 '12 at 01:30

1 Answers1

1

You can hide them using SYSTEM_UI_FLAG_HIDE_NAVIGATION:

myView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);

This property is only in 4.0+. The closest 3.0+ gets is SYSTEM_UI_FLAG_LOW_PROFILE.

But they should not (if they even can) be permanently disabled; imagine how you'd feel if an app took away your ability to use the "home" button, then started an infinite loop.

Edit: Wait, just read "Home, Power, and Search" buttons. You can't disable the power button (that would be silly), and most Android 4.0 phones don't have a dedicated search button unless they are upgrades of 2.3 devices (Galaxy S II, for example). My above info covers the soft Home, Back, and Recent Apps keys.

Cat
  • 66,919
  • 24
  • 133
  • 141