title: How to display images on ImageView from json data in android
body: <p>I am getting json data. In that json I have a url for an image. Now I want to display that Image in ImageView. How can I do acheive this? Here is my code</p>
  
  <pre><code>class LoadInbox extends AsyncTask&lt;String, String, String&gt; {
      /**
       * Before starting background thread Show Progress Dialog
       * */
      @Override
      protected void onPreExecute() {
          super.onPreExecute();
          pDialog = new ProgressDialog(Home.this);
          pDialog.setMessage("Loading Inbox ...");
          pDialog.setIndeterminate(false);
          pDialog.setCancelable(false);
          pDialog.show();
      }
  
      /**
       * getting Inbox JSON
       * */
   protected String doInBackground(String... arg0) {
          // Building Parameters
          List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();
  
          JSONObject json = userFunctions.homeData();
  
          Log.e("Data", json.toString());
  
          // Check your log cat for JSON reponse
          Log.d("Inbox JSON: ", json.toString());
  
          try {
              data = json.getJSONArray(TAG_DATA);
              Log.d("inbox array: ", data.toString());
              // looping through All messages
              for (int i = 0; i &lt; data.length(); i++) {
                  JSONObject c = data.getJSONObject(i);
  
                  // Storing each json item in variable
                  String profile_img = c.getString(TAG_PROFILE_IMG);
  
                  // creating new HashMap
                  HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
  
                  // adding each child node to HashMap key =&gt; value
                  map.put(TAG_PROFILE_IMG, profile_img);
  
                  // adding HashList to ArrayList
                  inboxList.add(map);
              }
          } catch (JSONException e) {
              e.printStackTrace();
          }
  
          return null;
      }
  protected void onPostExecute(String file_url) {
          // dismiss the dialog after getting all products
          pDialog.dismiss();
          // updating UI from Background Thread
          runOnUiThread(new Runnable() {
              public void run() {
                  /**
                   * Updating parsed JSON data into ListView
                   * */
                  ListAdapter adapter = new SimpleAdapter(
                          Home.this, inboxList,
                          R.layout.home_list_item, new String[] { TAG_PROFILE_IMG },
                          new int[] { R.id.profile_img2 });
                  // updating listview
                  setListAdapter(adapter);
              }
          });
  
      }
  </code></pre>
  
  <p>here is my layout</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:orientation="vertical" &gt;
  
  &lt;ImageView 
      android:id="@+id/profile_img2" 
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:paddingTop="8dip"
      android:paddingLeft="8dip"
      android:paddingBottom="4dip" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>