In XML, it would look something like this:
style="?header_background"
programmatically, it's a little trickier. In your activity:
private static Theme theme = null;
protected void onCreate(Bundle savedInstanceState) {
...
theme = getTheme();
...
}
public static int getThemeColors(int attr){
TypedValue typedvalueattr = new TypedValue();
theme.resolveAttribute(attr, typedvalueattr, true);
return typedvalueattr.resourceId;
}
And when you want to access an attribute of the theme, you would do something like this:
int outside_background = MyActivity.getThemeColors(R.attr.outside_background);
setBackgroundColor(getResources().getColor(outside_background));
It's a little more convoluted, but there you go ;-)