title: Set image in listview
body: <p>I am new in android and i am facing a problem in "ListAdapter adapter" line can any one help me below i mentioned my code in which image is not displaying because of map.put image value can't convert back to int from string.</p>
  
  <p><strong>MainActivity.java</strong></p>
  
  <pre><code>public class MainActivity extends Activity {
  
  private int id;
  private Time today = new Time(Time.getCurrentTimezone());
  private ImageView aImage;
  private Bitmap bMap;
  private ListView listView;
  private ArrayList&lt;HashMap&lt;String, String&gt;&gt; values = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
  
  @Override
  protected void onCreate(Bundle savedInstanceState)  {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      //aImage = (ImageView)findViewById(R.id.AImage);
  
      listView = (ListView) findViewById(R.id.list);
  
      java.lang.reflect.Field[] list = R.drawable.class.getFields();
      //for(int i=0;i&lt;list.length;i++){
      for (int i=0;i&lt;9;i++){
      try {
          id = list[i].getInt(null);
          today.setToNow();
  
          //System.out.println("------------------"+id+"---------------");
  
          bMap = BitmapFactory.decodeResource(getResources(), id);
  
          bMap = Bitmap.createScaledBitmap(bMap, 50, 50, true);
          //aImage.setImageBitmap(bMap);          
  
          HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
  
  
          map.put("img", String.valueOf(bMap));
  
          map.put("time", today.format("%k:%M"));
  
          values.add(map);
  
          new CheckinDetail().execute();          
  
  
      } catch (IllegalAccessException e1) {
          // TODO Auto-generated catch block
          e1.printStackTrace();
      }
  
      }       
  }
  
  class CheckinDetail extends AsyncTask&lt;String, String, String&gt; {
  
  
      @SuppressWarnings("deprecation")
      protected String doInBackground(String... args) {
  
          return null;
      }
  
      /**
       * After completing background task Dismiss the progress dialog
       * **/
      protected void onPostExecute(String file_url) {
  
          // updating UI from Background Thread
          runOnUiThread(new Runnable() {
              public void run() {
                  /**
                   * Updating parsed JSON data into ListView
                   * */
                  //int in = Integer.valueOf(et.getText().toString());
  
                  ListAdapter adapter = new SimpleAdapter(MainActivity.this, values,  R.layout.rowlayout, new String[] { "img","time"},new int[] { R.id.AImage, R.id.time});
  
                    listView.setAdapter(adapter);
                    listView.setCacheColorHint(Color.TRANSPARENT);
  
              }
          });
  
      }
  }
  }
  </code></pre>