First of all it\'s not a duplicate as in How to change the background color of android status bar
How do I change the status bar color which should be same as in nav
change the colorPrimaryDark to your desire color into the res/values/styles.xml file
<resources>
<color name="colorPrimary">#800000</color>
<color name="colorPrimaryDark">#303F9F</color> //This Line
<color name="colorAccent">#FF4081</color>
<color name="red">#FF0000</color>
<color name="white">#FFFFFF</color>
<color name="cream">#fffdd0</color>
<color name="burgundy">#800000</color>
</resources>
To Change the color of the status bar go to
res/values-v21/styles.xml
and color of status bar
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="colorPrimary">@color/color_primary</item>
<item name="colorPrimaryDark">@color/color_secondary</item>
<item name="colorAccent">@color/color_accent</item>
<item name="android:statusBarColor">#0000FF</item>
</style>
</resources>
One more solution:
final View decorView = w.getDecorView();
View view = new View(BaseControllerActivity.this);
final int statusBarHeight = UiUtil.getStatusBarHeight(ContextHolder.get());
view.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, statusBarHeight));
view.setBackgroundColor(colorValue);
((ViewGroup)decorView).addView(view);