-2

enter image description here

my requirement(security purpose) is when user log into my app he is not allow to

  1. close app
  2. navigate to another app
  3. not allow to change setting

so to fulfilled this requirement i want to

  1. Hide Bottom navigation Bar (or)
  2. disable Bottom navigation bar

i try to hide bottom navigation bar using this code

    View decorView = getWindow().getDecorView();
    int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION ;
    decorView.setSystemUiVisibility(uiOptions);

but when i touch screen again Bottom navigation reappear

This is banking app banking people requesting to do that if there any possibility do this task or if you have any other solution please give me

damith alahakoon
  • 270
  • 4
  • 14
  • Related https://stackoverflow.com/questions/16713845/permanently-hide-navigation-bar-in-an-activity/26013850 and https://stackoverflow.com/questions/25471490/disabling-and-hiding-android-navigation-bar-notification-menu-permanently – AskNilesh Sep 18 '18 at 05:36
  • https://stackoverflow.com/questions/2068084/kiosk-mode-in-android – AskNilesh Sep 18 '18 at 05:37
  • you should not be able to implement what you want. That is totally not up to you to decide if user can exit your app. – Vladyslav Matviienko Sep 18 '18 at 05:39
  • i am developing banking application for sunmi pos device banking people requesting for me to use there application only this pos device – damith alahakoon Sep 18 '18 at 05:46
  • then you probably can gain a root access on that device, or use a kiosk mode. Or develop your app as a launcher app on it. – Vladyslav Matviienko Sep 18 '18 at 05:50

2 Answers2

2

It can not be permanently hidden- it would be android security issue

Lixas
  • 6,938
  • 2
  • 25
  • 42
2

Try this:

View decor_View = getWindow().getDecorView();

int ui_Options = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;

decor_View.setSystemUiVisibility(ui_Options);

But it need device android OS version is 4.4 or higher.

navylover
  • 12,383
  • 5
  • 28
  • 41