Just set it to true
windowLightStatusBar
in style in of the styles.xml
file. This will change the icons to gray (no custom colors). See:
<item name="android:windowLightStatusBar">true</item>
Note : This only works from the API 23 . For example: values-v23/styles.xml
. Or you can enter the property targetApi
being like 23 this way:
<item name="android:windowLightStatusBar" tools:targetApi="23">true</item>
ImageofRomanNurik Google+ post
You can also do this programmatically, see:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
View decor = getWindow().getDecorView();
if (shouldChangeStatusBarTintToDark) {
decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
} else {
decor.setSystemUiVisibility(0);
}
}
Note that you first need to check the version of the SDK you are using.