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