When I use resolveAttribute()
to find out a color value of ?attr/colorControlNormal
, I got 236
:
TypedValue typedValue = ne
I believe instead of this:
TypedValue typedValue = new TypedValue();
getTheme().resolveAttribute(R.attr.colorControlNormal, typedValue, true);
int color = typedValue.data;
You should do this:
TypedValue typedValue = new TypedValue();
getTheme().resolveAttribute(R.attr.colorControlNormal, typedValue, true);
int color = ContextCompat.getColor(this, typedValue.resourceId)