2

Is it possible to hide the notification bar on splash screen with the new Android 12 Splash screen API? So that the notification bar would be hidden from the very moment when the user launches an app.

I tried adding this to my Theme.SplashScreen

<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>

but it doesn't seem to do anything.

Blank空白
  • 117
  • 8
  • Does this answer your question? [How to hide status bar in android in just one activity](https://stackoverflow.com/questions/42968600/how-to-hide-status-bar-in-android-in-just-one-activity) – mefahimrahman Mar 16 '22 at 10:19
  • 1
    @mefahimrahman I do not use an activity for my splash screen. We are talking about the splash screen that was introduced in API 31. – Blank空白 Mar 16 '22 at 10:34
  • although you've used different theme this [documentation](https://developer.android.com/training/system-ui/status) may help. Thanks – mefahimrahman Mar 16 '22 at 10:47
  • @mefahimrahman thank you I tried but it does not help. I would like to know if hiding the notification bar is possible with the new SplashScreen API in Android 12, without workarounds. So the status bar would be hidden from the moment user launches an app, until the splash screen disappears. – Blank空白 Mar 16 '22 at 11:15
  • 1
    5 months later. I am having the very same issue. Has anybody found a solution for this? I have tried `actionBar?.hide()` both before and after `installSplashScreen()`. It doesn't work either way (and creates some real ugliness before). – Free Dorfman Aug 26 '22 at 10:43

1 Answers1

-1
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);

Put above code in onCreateMethod of the activity of Splash Screen.

Vijay
  • 1,163
  • 8
  • 22
  • 1
    I do not use an activity for my splash screen. We are talking about the splash screen that was introduced in API 31. Also, FLAG_FULLSCREEN is deprecated. – Blank空白 Mar 16 '22 at 10:33