I'm trying to change RatingBar
stars color but after migrating to Android API 23 my following codes don't work and give me an exception.
LayerDrawable ratingBarStars = (LayerDrawable) holder.ratingBar.getProgressDrawable();
ratingBarStars.getDrawable(0).setColorFilter(mContext.getResources()
.getColor(R.color.accent), PorterDuff.Mode.SRC_ATOP);
ratingBarStars.getDrawable(1).setColorFilter(mContext.getResources()
.getColor(R.color.accent), PorterDuff.Mode.SRC_ATOP);
ratingBarStars.getDrawable(2).setColorFilter(mContext.getResources()
.getColor(R.color.accent), PorterDuff.Mode.SRC_ATOP);
And the Error is:
java.lang.ClassCastException: android.support.v4.graphics.drawable.DrawableWrapperHoneycomb cannot be cast to android.graphics.drawable.LayerDrawable