title: Android: How do I get a ColorStateList from resources?
body: <p>I am making a navigation drawer where the icon is coloured based on the colour of the text.</p>
  <p>This is my <code>selector</code> declared in res/drawable</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;selector xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
      &lt;item android:state_focused=&quot;true&quot; android:color=&quot;@color/emerald&quot;/&gt;
      &lt;item android:state_selected=&quot;true&quot; android:color=&quot;@color/emerald&quot;/&gt;
      &lt;item android:state_pressed=&quot;true&quot; android:color=&quot;@color/emerald&quot;/&gt;
      &lt;item android:color=&quot;@android:color/white&quot;/&gt;
  &lt;/selector&gt;
  </code></pre>
  <p>This is my <code>ViewHolder</code></p>
  <pre class="lang-java prettyprint-override"><code>Drawable drawable = ContextCompat.getDrawable(mContext,iconResourceId);
  drawable = DrawableCompat.wrap(drawable);
  DrawableCompat.setTintList(drawable.mutate(),mContext.gerResouces.getColorStateList());
  mItemIcon.setImageDrawable(drawable);
  </code></pre>
  <p>As you can see the problem i am having is on this line, what do i pass in <code>getColorStateList</code>? The doucmentation is not helping me.</p>
  <pre><code>DrawableCompat.setTintList(drawable.mutate(),mContext.gerResouces.getColorStateList());
  </code></pre>