title: Android Custom Background Causing Number Format Exception with List Adapter
body: <p>So I'm getting some strange behavior with one of my Android apps.  I have two apps, both with the same custom background image, and one works just fine.  The other, however, does not want to cooperate.</p>
  
  <p>I add a custom theme in my AndroidManifest.xml via the following:</p>
  
  <pre><code>&lt;application
      ...
      android:theme="@style/MyTheme" &gt;
  </code></pre>
  
  <p>I change my styles.xml (the entire file) to the following:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;resources xmlns:android="http://schemas.android.com/apk/res/android"&gt;
    &lt;style name="MyTheme" parent="android:Theme.Holo"&gt;
      &lt;item name="android:background"&gt;@drawable/dummy_background_image&lt;/item&gt;
    &lt;/style&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>Again, this works just fine for app #1.  But app #2...</p>
  
  <p>When I call this:</p>
  
  <pre><code>    setListAdapter(new ArrayAdapter&lt;Game&gt;(getActivity(),
                                                    android.R.layout.simple_list_item_activated_1,
                                                    android.R.id.text1,
                                                    gameCategories.getCategories()));
  </code></pre>
  
  <p>It throws:</p>
  
  <pre><code>01-22 21:30:21.439: E/AndroidRuntime(28044): FATAL EXCEPTION: main
  01-22 21:30:21.439: E/AndroidRuntime(28044): java.lang.NumberFormatException: Invalid int: "res/drawable/dummy_background_image.png"
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at java.lang.Integer.invalidInt(Integer.java:138)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at java.lang.Integer.parse(Integer.java:375)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at java.lang.Integer.parseInt(Integer.java:366)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at com.android.internal.util.XmlUtils.convertValueToInt(XmlUtils.java:122)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at android.content.res.TypedArray.getInt(TypedArray.java:255)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at android.view.animation.Animation.&lt;init&gt;(Animation.java:251)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at android.view.animation.AlphaAnimation.&lt;init&gt;(AlphaAnimation.java:40)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at android.view.animation.AnimationUtils.createAnimationFromXml(AnimationUtils.java:117)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at android.view.animation.AnimationUtils.createAnimationFromXml(AnimationUtils.java:92)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at android.view.animation.AnimationUtils.loadAnimation(AnimationUtils.java:73)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at android.support.v4.app.ListFragment.setListShown(ListFragment.java:290)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at android.support.v4.app.ListFragment.setListAdapter(ListFragment.java:186)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at com.example.legacy.GameListFragment.updateListAdapter(GameListFragment.java:107)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at com.example.legacy.GameListActivity.updateListAdapter(GameListActivity.java:158)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at com.example.legacy.databaseAccess.DatabaseAccessTask.onPostExecute(DatabaseAccessTask.java:57)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at com.example.legacy.databaseAccess.DatabaseAccessTask.onPostExecute(DatabaseAccessTask.java:1)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at android.os.AsyncTask.finish(AsyncTask.java:631)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at android.os.AsyncTask.access$600(AsyncTask.java:177)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at android.os.Handler.dispatchMessage(Handler.java:99)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at android.os.Looper.loop(Looper.java:137)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at android.app.ActivityThread.main(ActivityThread.java:5455)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at java.lang.reflect.Method.invokeNative(Native Method)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at java.lang.reflect.Method.invoke(Method.java:525)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
  01-22 21:30:21.439: E/AndroidRuntime(28044):    at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>When I go through debug mode, the app does display the app briefly (before it gets to the list adapter) so it can at least find the file.</p>
  
  <p>Obviously, I get that it's a string, and casting it to an int is going to fail.  But why is this casting it to an int and not getting the corresponding number?  Why does it work for app #1 and app #2?</p>
  
  <p>Thanks in advance.</p>