Search code examples
javaandroidcolorsstatusbar

How to remove auto statusbar color changed in android


Whenever i start my app. It changes statusbar colour into white colour. Which is not looking good. I don't want this. How to not auto change this colour it should be default colour or something else.

enter image description here


Solution

  • Change the theme of your activity to FullscreenTheme written below :

     <style name="FullscreenTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:windowActionBarOverlay">true</item>
        <item name="android:windowBackground">@null</item>
    </style>
    

    Copy and paste the above code to your styles.xml file

    and modify the activity by copy and paste the code below before setContentView() method :

     requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);