i am trying to change color of my status bar to white with grey icons. i have tried almost every code solution for this problem but non of them worked for me.
i am using this java fucntion to change it and i am also posting my style(21) code.
public static void statusBarColor(Window window, Context ctx) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
//Window window = getActivity().getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.setStatusBarColor(ctx.getResources().getColor(R.color.statusbar_color));
}
}
this is my java code but its not working after thousand tries. and below is my style.xml (21)
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar" tools:targetApi="23">true</item>
</style>
if you think its duplicate of some other question then i should let you now i have tried 3,4 pages of google search and also implemented them.