Android color selector doesn't work with custom attributes
<p>I've got in attrs.xml</p>

<pre><code>&lt;resources&gt; 
    &lt;!-- theme specific colors --&gt;
    &lt;attr format="reference|color" name="foreground" /&gt;
    &lt;attr format="reference|color" name="background" /&gt; 
&lt;/resources&gt;
</code></pre>

<p>And then in theme.xml</p>

<pre><code>&lt;style name="MyTheme" parent="android:Theme.Black"&gt;
    &lt;item name="android:windowNoTitle"&gt;true&lt;/item&gt;
    &lt;item name="foreground"&gt;#0000FF&lt;/item&gt;
    &lt;item name="background"&gt;#00FF00&lt;/item&gt;
&lt;/style&gt;
</code></pre>

<p>I also created color selector named forground_to_background.xml</p>

<pre><code>&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;   
    &lt;item android:state_pressed="true" android:color="?background"/&gt; &lt;!-- pressed --&gt;
    &lt;item android:state_focused="true" android:color="?background"/&gt; &lt;!-- focused --&gt;
    &lt;item android:color="?foreground"/&gt; &lt;!-- default --&gt;
&lt;/selector&gt;
</code></pre>

<p>Now I'd like to use it all together in TextView:</p>

<pre><code>&lt;TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textColor="@color/forground_to_background" /&gt;
</code></pre>

<p>Unfortunately it doesn't work. Instead of having nice green blue colors I've got only one color - red. TextView is always red. When I change TextView to use "?foreground" color will change. Also when I change in colors selector from "?xxxx" to hardcoded value as "#00f" color start to work.</p>

<p>Where is problem? What am I doing wrong?</p>

<p><strong>Edit:</strong>
I believe it is duplicate of problem/bug <a href="http://stackoverflow.com/questions/3757696/can-a-selector-resource-use-a-color-defined-in-a-style">Can a selector resource use a color defined in a style?</a></p>

<p><strong>Edit2:</strong>
Moreover when I try use this TextView in ListView application crashes. It cannot parse XML.</p>
