How to disable navigation bar for my android app

15.3k Views Asked by At

I want to disable navigationbar for my android app. When my application open home button and recent app button disable.

How can I disable button when app is running?

Like pattern lock app, in this app when open lock screen disable all button.

1

There are 1 best solutions below

6
On

You can set the SYSTEM_UI_FLAG_HIDE_NAVIGATION flag in your activity's onResume method.

This should help: http://developer.android.com/training/system-ui/navigation.html

Edit:

So it looks like you want something like this: https://stackoverflow.com/a/32983295/6176618

This this isn't officially supported and the workaround provided here is an obvious hack but it should serve your purposes.