Lollipop status bar color does not change

If you are using the material theme in Android and your status bar color is not changing you need to add the following code for it to work:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
}

You may also like...