user1698858
user1698858

Reputation: 11

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

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

Upvotes: 1

Views: 785

Answers (1)

Cat
Cat

Reputation: 67522

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.

Upvotes: 1

Related Questions