java.lang.NullPointerException when loading drawable which exists in each res/drawable-"density" folder
<p>I have a drawable resource called obstacle.png which exists in each of my drawable-"density" folders.  Yet, whenever I run the app, I get a null pointer exception when I am assigning the bitmap's width to my _width variable.  This code will only run on mdpi and on the Galaxy TAB addon AVDs.  It fails on ldpi or hdpi AVDs.  Why?</p>

<pre><code>19 public Weapon(Context context) {
20      super(context);
21      _weapon = BitmapFactory.decodeResource(getResources(), R.drawable.obstacle);
22      _width = _weapon.getWidth();
23      _height = _weapon.getHeight();
24  } //constructor



LogCat: 
Caused by: java.lang.NullPointerException
at com.shootball.Weapon.&lt;init&gt;(Weapon.java:22)
</code></pre>
