title: Custom View with Layer-List background drawable renders black screen
body: <p>I'm trying to build a custom android view and apply a background drawable that is a layer-list.</p>
  
  <p>The layer-list has two items:</p>
  
  <ol>
  <li>A background color (white)</li>
  <li>A simple shape drawable that is a stroked rectangle with rounded-corners</li>
  </ol>
  
  <p>here's the drawable xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;item android:drawable="@android:color/white"/&gt;
      &lt;item&gt;
          &lt;shape xmlns:android="http://schemas.android.com/apk/res/android"
              android:shape="rectangle"&gt;
              &lt;corners android:radius="1dp" /&gt;
              &lt;stroke
                  android:width="2dp"
                  android:color="@color/background_green" /&gt;
          &lt;/shape&gt;
      &lt;/item&gt;
  &lt;/layer-list&gt;
  </code></pre>
  
  <p>The custom view is a class derving from Android.view.View that currently has NO functionality except the required measuring overloads.</p>
  
  <p>I'm applying the background in the view definition in an activity layout:</p>
  
  <pre><code>&lt;view
      android:layout_width="match_parent"
      android:layout_height="300dp"
      class="com.example.widget.TestView"
      android:id="@+id/view2"
      android:layout_gravity="center_horizontal"
      android:background="@drawable/rect_sig_cap"
      android:layout_margin="20dp" /&gt;
  </code></pre>
  
  <p>What I <em>expect</em> to see is a view with a white background and a green border. What I <em>actually</em> see when I deploy the project is a view with a black background and a green border.</p>
  
  <p>Interestingly it appears correctly in the designer preview in Android Studio. It's only when I deploy it to a device that it renders black. </p>
  
  <p>Am I missing something obvious here?</p>