10

I am using the code below to change the color of Indeterminate ProgressBar. This works well, till KitKat. But on Lollipop, it just stays Green. Can anyone help me out with this. I want to do it through Java and not XML.

Code: This sets the spinner color to pink

pd.getIndeterminateDrawable().setColorFilter(0xFFeA6060,
                    android.graphics.PorterDuff.Mode.MULTIPLY); 
Cœur
  • 34,719
  • 24
  • 185
  • 251
Vamsi Challa
  • 10,690
  • 30
  • 96
  • 146

1 Answers1

23

You're using multiply which means that you will change to a color depending on the current color (which is green):

enter image description here

Try using android.graphics.PorterDuff.Mode.SRC_ATOP for example.

If want to use the real color that you provided then use PorterDuff.Mode.SRC_IN

Pedro Oliveira
  • 20,371
  • 8
  • 53
  • 82