title: Load fetched Images into listView Using SimpleAdapter
body: <p>I'm stuck with this problem. I fetched the image from web url(Though it is localHost) and other stuffs too.
  However, Other stuffs are showed up but images is not.
  I can't figured out what's wrong.
  I'm posting the code of my class. Check it out.
  Here is code:</p>
  
  <pre><code>public void updateJSONData() {
  
      int success;
      Bitmap photo = null;
  
      Intent in = getIntent();
      Bundle extras = in.getExtras();
      String city = extras.getString("CITY");
      Log.d(TAG, "City received: " + city);
  
      try {
  
          JSONParser jParser = new JSONParser();
          List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();
          params.add(new BasicNameValuePair("CITY", city));
  
          JSONObject json = jParser.makeHttpRequest(FETCH_HOSTEL_URL, "POST",
                  params);
          Log.d("Json response", json.toString());
  
          success = json.getInt(TAG_SUCCESS);
          if (success == 1) {
  
              mHostels = json.getJSONArray(TAG_HOSTELS);
              mHostelList = new ArrayList&lt;HashMap&lt;String, Object&gt;&gt;();
  
              for (int i = 0; i &lt; mHostels.length(); i++) {
                  JSONObject c = mHostels.getJSONObject(i);
  
                  Drawable d = null;
                  String hos_name = c.getString(TAG_NAME);
                  String hos_rent = c.getString(TAG_RENT);
                  // String hos_img = c.getString(TAG_IMG);
                  String hos_imgURL = "http://192.168.2.10:80/homey_uploads/avtars/IMG_-137606592.jpg";
  
                  try {
  
                      getBitmapFromUrl(hos_imgURL);
                      photo = bmp;
                      cityCap.setImageBitmap(photo);
  
                  } catch (Exception ex) {
                      Log.d(TAG, "Bitmap Not Received");
                  }
  
                  HashMap&lt;String, Object&gt; map = new HashMap&lt;String, Object&gt;();
                  map.put(TAG_NAME, hos_name);
                  map.put(TAG_RENT, hos_rent);
                  map.put(TAG_IMG, photo);
  
                  mHostelList.add(map);
                  Log.d(TAG, "Map Addedd!!" + mHostelList.toString());
              }
          } else if (success == 0) {
              Log.d(TAG, "Fetch Failure!!");
              done = false;
              msg = json.getString(TAG_MESSAGE);
          }
  
      } catch (Exception e) {
          Log.d(TAG, "Exception occured:" + e.toString());
          done = false;
      }
  }
  
  private static Bitmap getBitmapFromUrl(String hos_imgURL) throws IOException {
  
      URL IMGURL = new URL(hos_imgURL);
      Log.d(TAG, "Image Url:" + IMGURL.toString());
      HttpURLConnection conn = (HttpURLConnection) IMGURL.openConnection();
      conn.setDoInput(true);
      conn.connect();
  
      conn.setConnectTimeout(30000);
      conn.setReadTimeout(30000);
  
      InputStream is = conn.getInputStream();
      bmp = BitmapFactory.decodeStream(is);
  
      return bmp;
  }
  
  public void updateList() {
  
      // LazyAdapter adapter = new LazyAdapter(SearchResult.this,
      // mHostelList);
  
      ListAdapter adapter = new SimpleAdapter(SearchResult.this, mHostelList,
              R.layout.single_hostel, new String[] { TAG_NAME, TAG_RENT,
                      TAG_IMG }, new int[] { R.id.tv_h_name, R.id.tv_h_rent,
                      R.id.iv_h_frontPic });
  
      SimpleAdapter.ViewBinder viewBinder = new SimpleAdapter.ViewBinder() {
  
          @Override
          public boolean setViewValue(View view, Object data,
                  String textRepresentation) {
              if (view.getId() == R.id.tv_h_name) {
                  ((TextView) view).setText((String) data);
                  return true;
              } else if (view.getId() == R.id.tv_h_rent) {
                  ((TextView) view).setText((String) data);
              } else if (view.getId() == R.id.iv_h_frontPic) {
                  ((ImageView) view).setImageBitmap((Bitmap) data);
              }
              return false;
          }
      };
      ((SimpleAdapter) adapter).setViewBinder(viewBinder);
  
      setListAdapter(adapter);
  
      ListView lv = getListView();
      lv.setOnItemClickListener(new OnItemClickListener() {
  
          @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                  int position, long id) {
  
              Intent intent = new Intent(SearchResult.this,
                      HDetailTabActivity.class);
              startActivity(intent);
          }
      });
  
  }
  
  public class LoadHostels extends AsyncTask&lt;Void, Void, Boolean&gt; {
  
      @Override
      protected void onPreExecute() {
  
          super.onPreExecute();
          pDialog = new ProgressDialog(SearchResult.this);
          pDialog.setMessage("Loading Hostels");
          pDialog.setIndeterminate(false);
          pDialog.setCancelable(true);
          pDialog.show();
      }
  
      @Override
      protected Boolean doInBackground(Void... arg0) {
  
          updateJSONData();
          return null;
      }
  
      @Override
      protected void onPostExecute(Boolean result) {
          super.onPostExecute(result);
  
          pDialog.dismiss();
          if (done != true) {
              Toast.makeText(SearchResult.this, "Error:" + msg,
                      Toast.LENGTH_LONG).show();
          } else if (done = true) {
              updateList();
          }
      }
  
  }
  </code></pre>
  
  <p>Logcat says that unable to decodeStream but when i set the image to another imageview itshowed up.
  Attaching Logcat:</p>
  
  <pre><code>04-12 14:38:34.857: D/TRACKING...(8616): Map Addedd!![{h_img=android.graphics.Bitmap@4149d108, h_name=M R Hostel, h_d_mrent=4500}, {h_img=android.graphics.Bitmap@41600b78, h_name=Hostel Of Achievers, h_d_mrent=3500}, {h_img=android.graphics.Bitmap@414edd18, h_name=Hostel Of Care, h_d_mrent=2500}]
  04-12 14:38:34.860: D/OpenGLRenderer(8616): Flushing caches (mode 0)
  04-12 14:38:34.898: E/BitmapFactory(8616): Unable to decode stream: java.io.FileNotFoundException: /android.graphics.Bitmap@4149d108: open failed: ENOENT (No such file or directory)
  04-12 14:38:34.898: I/System.out(8616): resolveUri failed on bad bitmap uri: android.graphics.Bitmap@4149d108
  04-12 14:38:34.914: E/BitmapFactory(8616): Unable to decode stream: java.io.FileNotFoundException: /android.graphics.Bitmap@41600b78: open failed: ENOENT (No such file or directory)
  04-12 14:38:34.914: I/System.out(8616): resolveUri failed on bad bitmap uri: android.graphics.Bitmap@41600b78
  04-12 14:38:34.929: E/BitmapFactory(8616): Unable to decode stream: java.io.FileNotFoundException: /android.graphics.Bitmap@414edd18: open failed: ENOENT (No such file or directory)
  04-12 14:38:34.929: I/System.out(8616): resolveUri failed on bad bitmap uri: android.graphics.Bitmap@414edd18
  </code></pre>
  
  <p>Please Help!!!   </p>