title: Custom view has subviews which don't update when I set their state
body: <p>I have a custom view which has within it various subviews. If I change the font color for the subviews the change doesn't appear on screen.</p>
  
  <p>The model looks like:</p>
  
  <pre><code>[customview]
     [button1 /] [button2 /] [button3 /] ...
  [/customview]
  </code></pre>
  
  <p>with fontcolor black changing to fontcolor grey. Doesn't work whether I call invalidate or not:</p>
  
  <pre><code>int numChildren = getChildCount();
  
      if (numChildren &gt; 0) {
          for (int i = 0; i &lt; numChildren; i++) {
              if (getChildAt(i) instanceof Button) {
                  Button l = (Button) getChildAt(i);
                  l.setEnabled(false);
                  l.setTextColor(getResources().getColor(R.color.gray));
                  l.invalidate();
              }
          }
  
      }
  </code></pre>
  
  <p>How can I get the change to "take" in the view? So far the only thing that works is removing all the childviews and then laboriously readding them with the new font color - but this is extremely slow and inefficient.</p>
  
  <p>EDIT: I made sure that the change was being propogated using the following code:</p>
  
  <pre><code>if (getChildAt(i) instanceof Button) {
                  Button l = (Button)getChildAt(i);
                  l.setEnabled(false);
                  Log.d("Log","State was " +String.valueOf(l.isEnabled()));
              }
  </code></pre>
  
  <p>And I receive log messages proving that the state of the buttons is changing, however the font color doesn't change. Here is the color xml that I use for the buttons:</p>
  
  <pre><code>&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  &lt;item android:state_enabled="false"
      android:color="@color/gray" /&gt;
  &lt;item android:state_enabled="true"
      android:color="@color/black"/&gt;
  </code></pre>
  
  <p></p>