title: Error inflating Button
body: <p>I have a layout with a Button on it:</p>
  
  <pre><code>&lt;Button
      android:id="@+id/myapp_new"
      style="@style/header_button"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentRight="true"
      android:layout_centerVertical="true"
      android:background="@drawable/header_button"
      android:gravity="center"
      android:text="new" /&gt;
  </code></pre>
  
  <p>The style for the button is defined as such:</p>
  
  <pre><code>&lt;style name="header_button" parent="@android:style/TextAppearance.Medium"&gt;
      &lt;item name="android:textColor"&gt;@color/white&lt;/item&gt;
      &lt;item name="android:textSize"&gt;16sp&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>When I open this Activity on my phone, I receive a crash.  The crash happens during the line that sets the content view:</p>
  
  <pre><code>setContentView(R.layout.layout_tags);
  </code></pre>
  
  <p>If I remove the <code>android:background</code> parameter, the crash goes away.  I don't understand because the drawable is included in the app and it works fine on other devices, including the emulator.</p>
  
  <p>I will post the error log at the bottom of this thread.</p>
  
  <p>As I said, this crash is only happening on 1 of my devices (I have 2 + emulator).  It is occurring on an older phone running Android 2.2.1, but is not occurring on my emulator (running 2.2) or my newer phone (running 4.1.2).</p>
  
  <p>The biggest difference is my device with the crash has a low screen resolution.  I have no images in the ldpi folder.  I was under the impression that Android would automatically choose the image from the next folder up.  Also, I have lots of other images that load just fine.</p>
  
  <p>I'd really like to release my app into the Google Play store, but this is holding me up.  I worry that this crash will happen on other people's phones even though I can only reproduce it on one device.  Does anyone have any ideas?  I'm lost.</p>
  
  <pre><code>11-26 12:03:04.740: E/AndroidRuntime(2800): FATAL EXCEPTION: main
  11-26 12:03:04.740: E/AndroidRuntime(2800): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp.app/com.myapp.app.activity.ActivityTags}: android.view.InflateException: Binary XML file line #65: Error inflating class android.widget.Button
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.os.Handler.dispatchMessage(Handler.java:99)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.os.Looper.loop(Looper.java:123)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.app.ActivityThread.main(ActivityThread.java:4627)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at java.lang.reflect.Method.invokeNative(Native Method)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at java.lang.reflect.Method.invoke(Method.java:521)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at dalvik.system.NativeStart.main(Native Method)
  11-26 12:03:04.740: E/AndroidRuntime(2800): Caused by: android.view.InflateException: Binary XML file line #65: Error inflating class android.widget.Button
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.app.Activity.setContentView(Activity.java:1647)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at com.myapp.app.activity.ActivityTags.onCreate(ActivityTags.java:75)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     ... 11 more
  11-26 12:03:04.740: E/AndroidRuntime(2800): Caused by: java.lang.reflect.InvocationTargetException
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.widget.Button.&lt;init&gt;(Button.java:65)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at java.lang.reflect.Constructor.constructNative(Native Method)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.view.LayoutInflater.createView(LayoutInflater.java:500)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     ... 26 more
  11-26 12:03:04.740: E/AndroidRuntime(2800): Caused by: java.lang.StackOverflowError
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.StateListDrawable$StateListState.&lt;init&gt;(StateListDrawable.java:255)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.StateListDrawable.&lt;init&gt;(StateListDrawable.java:301)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.StateListDrawable.&lt;init&gt;(StateListDrawable.java:68)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:750)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.Drawable.createFromXml(Drawable.java:729)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.content.res.Resources.loadDrawable(Resources.java:1694)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.content.res.Resources.getDrawable(Resources.java:581)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:160)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:788)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.Drawable.createFromXml(Drawable.java:729)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.content.res.Resources.loadDrawable(Resources.java:1694)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.content.res.Resources.getDrawable(Resources.java:581)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:160)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:788)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.Drawable.createFromXml(Drawable.java:729)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.content.res.Resources.loadDrawable(Resources.java:1694)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.content.res.Resources.getDrawable(Resources.java:581)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:160)
  11-26 12:03:04.740: E/AndroidRuntime(2800):     at android.graphics.drawable.Drawable.createF
  </code></pre>