title: BitmapFactory.decodeResource() returns null for shape defined in xml drawable
body: <p>I looked through multiple similar questions, although I haven't found a proper answer to my issue.</p>
  <p>I have a drawable, defined in shape.xml</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;shape xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; android:shape=&quot;rectangle&quot; &gt;
  
      &lt;solid android:color=&quot;@color/bg_color&quot; /&gt;
  &lt;/shape&gt;
  </code></pre>
  <p>I want to convert it to Bitmap object in order to perform some operations, but <code>BitmapFactory.decodeResource()</code> returns null.</p>
  <p>This is how I'm doing it:</p>
  <pre><code>Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.shape);
  </code></pre>
  <p>What am I doing wrong? Is <code>BitmapFactory.decodeResource()</code> applicable for xml defined drawables?</p>