1

When we first started building our app, the statusbar automaticly use the colorPrimaryDark specified in the color.xml file. Now after a couple of weeks of codeing, we noticed that it doesn't work anymore and it uses the color colorPrimary instead. To get around this we now have these two statements on all of our activities:

 Window window = this.getWindow();
 window.setStatusBarColor(getResources().getColor(R.color.colorPrimaryDark));

Which seems a bit confusing to us. I have searched for this question before and I understood that it was a bug wihtin the appcompat framework. We are currently using 23.2.1, our minSdkVersion is 15 and targetSdkVersion is 23.

Does anyone know what we might have done to break this, or is this some kind of bug within Android Studio?

Essej
  • 892
  • 6
  • 18
  • 33

1 Answers1

1

I have using this.

Window window = this.getWindow();
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                window.setStatusBarColor(getResources().getColor(R.color.colorPrimaryDark));
            }
user3432681
  • 564
  • 4
  • 10
  • 25