-1

Above action bar, white color is displaying. I want to fix that one. Please check attached image file.

Thanks in Advance Image Here

user3359125
  • 141
  • 1
  • 1
  • 6

2 Answers2

1

Try this:

 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        Window window = getWindow();
        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        window.setStatusBarColor(Color.parseColor("#39bf96"));
    }
SuperFrog
  • 7,631
  • 9
  • 51
  • 81
0

However if you want to hide those Action Bar or Status Bar, this would help

add this line into your style resources file.

<style name="AppFullScreenTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowActionBar">false</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowContentOverlay">@null</item>
</style>

and then make sure you change the theme in your AndroidManifest file.

Example

<activity android:name=".MainActivity"
        android:label="@string/mainPageName" //Your Activity Name
        android:theme="@style/AppTheme.NoActionBar"> //Change HERE
</activity>
Kopi Bryant
  • 1,300
  • 1
  • 15
  • 30