0

In the application I am working on it's required to have completely transparent statusBar. I am able to hide the statusBar perfectly from the LAUNCHER_ACTIVITY but there is still sometime before the activity appears there is like one second where I still can see the statusBar not transparent and once the onCreate function/method of the LAUNCHER_ACTIVITY gets executed, it makes the statusBar completely transparent.

I need to be able to control the status bar during that time, I guess the only place in the code where I can take action is the Application class but how to access the UI there?

Mohammad Elsayed
  • 1,885
  • 1
  • 20
  • 46

1 Answers1

1

Solution

Put <item name="android:windowNoTitle">true</item> in your theme.

Explanation

It will prevent the title bar from loading, so you don't have to hide it in your code.

If you are directly using a theme from Android, you can go to your themes.xml and extend the theme you are using and use that one in AndroidManifest.xml:

<style name="<EnterYourTheme>.CustomTheme">
        <item name="android:windowNoTitle">true</item>

        <!-- EDIT (how to do it for the action bar) -->
        <item name="windowActionBar">false</item>
</style>

Source

Cactusroot
  • 1,019
  • 3
  • 16