title: setImageResource throws an exception to load image on the ImageView
body: <p>I am trying to display the image on the screen using <code>ImageView. setImageResource</code> fails. Here is my XML :</p>
  
  <p>
   </p>
  
  <pre><code>&lt;FrameLayout
   android:orientation="vertical"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"
   android:layout_weight="1"&gt;
   &lt;ImageView 
       id="@+id/batteryLevelview" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_gravity="center"/&gt;
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>  @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main); 
       ImageView batteryLevelImage = (ImageView) findViewById(R.id.batteryLevelview);
       batteryLevelImage.setImageResource(R.drawable.notconnected);
     }    
  </code></pre>
  
  <p>What's wrong in my code? Can you please help me to find what's wrong. I would like to update image on the <code>ImageView</code> object based on criteria. I tried using <code>LinearLayout</code> and that did not help.</p>
  
  <p>thanks.</p>