4

I am using Android studio, and I have set up my main Activity in order to not show the statusBar. But when I display an alert dialog, the status bar reapears, and it won't hide after. (Also if I receive a notfication on my phonem the status bar will also show up and not hide)

How can I fix that? Can I set my entire app to keep the status Bar hidden?

Here is my current setting: in onCreate()

View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
KJ Newtown
  • 328
  • 1
  • 16

1 Answers1

3

I found a working solution!

In my onCreate method, I replaced the previous code by this one:

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
KJ Newtown
  • 328
  • 1
  • 16