1

I built a very simple app that just consists of a webview of a website. On my onCreate I am calling the following Fullscreen function:

getWindow().getDecorView().setSystemUiVisibility(
        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);

Combined with

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

in my manifest this work perfectly fine, the title bar is hidden as well as the hardware buttons on the bottom.

The problem is that I have a search bar on my website. As soon as you click it, the softkeyboard pops up (which is fine). But whenever the softkeyboard is hidden again, the hardware buttons are not hidden anymore. I can hide them again for example by calling the function again, but I would prefer that

a) The hardware buttons hide automatically or

b) A softkeyboard listener which hides the hardware buttons.

I did not figure out how to proceed with a) and I am stuck at b) after visiting dozens of websites that built a helper class for the softkeyboard listener (http://tech.leolink.net/2014/02/a-hack-to-catch-soft-keyboard-showhide.html) I think the problem is that I am using a webview inside my Layout.

*****UPDATE*******

I found this answer here: Immersive mode navigation becomes sticky after volume press or minimise-restore

I just call the UiChangeListener onCreate and it will always go back to Fullscreen Mode.

Community
  • 1
  • 1
Stef
  • 644
  • 1
  • 8
  • 25
  • I don't understood what you mean by "hardware button", you want to hide them? Hardware is physical... Can you post some images or explain this? – Ricardo A. Mar 02 '16 at 19:16

0 Answers0