I'm new to developing with android java. I am trying to set a button's background and textcolor to colorPrimary and colorOnPrimary values from /values/themes/themes.xml so that on dark theme buttons still would look normal.
I need to get these values programmatically i think. getResources().getColor(R.color.xxx) method only returns the colors that are set from /values/colors.xml
I couldn't find any duplicates of this issue, please read carefully what i'm trying to get. Also, I didn't particularly set my own theme. I adjusted the preset themes. (themes.xml and themes.xml (night))
 
    