I need to programmatically set a view's color to ?android:attr/textColorPrimary which is an attribute from the android's dark theme compatible attributes. Now it is possible to get colorButtonNormal with
R.attr.colorButtonNormal
But not ?android:attr/textColorPrimary and ?android:attr/colorBackground. Is there anyway to also get these attributes programmatically?
You can use
android.R.attr.textColorPrimary
.Something like:
In Java: