title: Android set Image Bitmap issue
body: <p>I'm working on a project which communicate with web server and download some photos. I want these photos to be shown on a listview after the download,but it's throwing me a <code>NullPointerException</code>. Here is the code I'm using :</p>
  
  <pre><code>   private ArrayList &lt;HashMap&lt;String, Object&gt;&gt; items;
      private static final String NAMEKEY = "bookname";
      private static final String INFOKEY = "bookprice";
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.mystampii_layout);
      }
          });
  
          ListView listView = (ListView)findViewById(R.id.mystampii_listview);
          items = new ArrayList&lt;HashMap&lt;String,Object&gt;&gt;();
          HashMap&lt;String, Object&gt; hm;
  
  
          final Bitmap b = BitmapFactory.decodeFile("/sdcard/MediaCard2a44bb1f782925923195ee546e7ef395.jpg", null);
          ImageView brum = (ImageView) findViewById(R.id.main_img);
          brum.setImageBitmap(b);
  
  
          hm = new HashMap&lt;String, Object&gt;();
          hm.put(NAMEKEY, "Moto GP 2010");
          hm.put(INFOKEY, "98 Stampii");
          items.add(hm);
  
            // Define SimpleAdapter and Map the values with Row view R.layout.listbox
             SimpleAdapter adapter = new SimpleAdapter(this, items, R.layout.main_listview,
                      new String[]{NAMEKEY,INFOKEY}, new int[]{R.id.main_img,R.id.main_name, R.id.main_info});
  
              listView.setAdapter(adapter);
              listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
      }
  </code></pre>
  
  <p>I know, why I'm getting NullPointerException : because my <code>ImageView brum</code> is placed in <code>R.layout.main_listview</code> and I'm setting as Content on this activity <code>R.layout.mystampii_layout</code>. I really can get the idea how to set the Image from SDCard to a ImageView from another layout.</p>
  
  <p>Any suggestions how can I do that, or how can I show the downloaded image from SDCard in listview.</p>
  
  <p>Thanks really for any kind of help!!!</p>