It's impossible. The styles.xml styles are compiled into a block of data available to your application, and there is no provision for cross-referencing Java elements during assembly or runtime.
However, you can programmatically change the background color of the corresponding elements at runtime, as they are pumped up in your Java class.
source
share