title: How do I add image from Hashmap url to a listview item?
body: <p>In the followimg class, I have imported a thumb image using an hashmap, which is saved as a string. However, I wish to pass, via an intent, this image to a 
  listview single item ie a detailed view. How do I add the s_thumb string to an
  imageview in the detailed activity?
  Here is the main activity, with the intent set out at the bottom:</p>
  
  <pre><code>import java.io.ByteArrayOutputStream;
  import java.util.ArrayList;
  import java.util.HashMap;
  
  import org.w3c.dom.Document;
  import org.w3c.dom.Element;
  import org.w3c.dom.NodeList;
  
  
  import android.app.Activity;
  import android.content.Intent;
  import android.graphics.Bitmap;
  import android.graphics.BitmapFactory;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.AdapterView;
  import android.widget.ImageView;
  import android.widget.AdapterView.OnItemClickListener;
  import android.widget.ListView;
  
  public class CustomizedListView extends Activity {
      // All static variables
      static final String URL = "http://padihamcars.com/music.xml";
      // XML node keys
      static final String KEY_SONG = "song"; // parent node
      static final String KEY_ID = "id";
      static final String KEY_TITLE = "title";
      static final String KEY_ARTIST = "artist";
      static final String KEY_DURATION = "duration";
      static final String KEY_THUMB_URL = "thumb_url";
  
      ListView list;
      LazyAdapter adapter;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
  
          final ArrayList&lt;HashMap&lt;String, String&gt;&gt; songsList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
  
          XMLParser parser = new XMLParser();
          String xml = parser.getXmlFromUrl(URL); // getting XML from URL
          Document doc = parser.getDomElement(xml); // getting DOM element
  
          NodeList nl = doc.getElementsByTagName(KEY_SONG);
          // looping through all song nodes &lt;song&gt;
          for (int i = 0; i &lt; nl.getLength(); i++) {
              // creating new HashMap
              HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
              Element e = (Element) nl.item(i);
              // adding each child node to HashMap key =&gt; value
              map.put(KEY_ID, parser.getValue(e, KEY_ID));
              map.put(KEY_TITLE, parser.getValue(e, KEY_TITLE));
              map.put(KEY_ARTIST, parser.getValue(e, KEY_ARTIST));
              map.put(KEY_DURATION, parser.getValue(e, KEY_DURATION));
              map.put(KEY_THUMB_URL, parser.getValue(e, KEY_THUMB_URL));
  
              // adding HashList to ArrayList
              songsList.add(map);
          }
  
  
          list=(ListView)findViewById(R.id.list);
  
          // Getting adapter by passing xml data ArrayList
          adapter=new LazyAdapter(this, songsList);        
          list.setAdapter(adapter);
  
  
          // Click event for single list row
          list.setOnItemClickListener(new OnItemClickListener() {
  
              @Override
              public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                      int position, long id) {
  
  
  
                   HashMap&lt;String, String&gt; resultp = new HashMap&lt;String, String&gt;();
                      resultp   = songsList.get(position);
                      String s_thumb=resultp.get(KEY_THUMB_URL);
                      String s_title=resultp.get(KEY_TITLE);
                      Intent intent = new Intent(CustomizedListView.this, SingleListItem_Attractions.class);
                      intent.putExtra("s_id", s_thumb);
                      intent.putExtra("s_title", s_title);
                      //other fields you want to send
                      startActivity(intent);
  
              }
          });     
      }   
  </code></pre>
  
  <p>And here is my detailed activity (single item):</p>
  
  <pre><code>import android.app.Activity;
  import android.content.Context;
  import android.content.Intent;
  import android.graphics.Bitmap;
  import android.graphics.BitmapFactory;
  import android.net.Uri;
  import android.os.Bundle;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  import android.widget.TextView;
  import android.widget.ImageView;
  
  public class SingleListItem_Attractions extends Activity{
      Button button;
      Button button2;
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          this.setContentView(R.layout.single_list_item_view);
  
  
          ImageView imageView = (InageView) findViewById(R.id.imageView1);
          Intent i2 = getIntent();
          String text2 =i2.getStringExtra("s_thumb");
          imageView.setImageBitmap(text2);
  
  
          TextView texts = (TextView) findViewById(R.id.textView1);
          Intent i = getIntent();
  
          String text1 =i.getStringExtra("s_title");
  
          texts.setText(text1);
  
          addListenerOnButton();
  
      }
  
      public void addListenerOnButton() {
  
          final Context context = this;
  
          button = (Button) findViewById(R.id.button1);
          button2 = (Button) findViewById(R.id.button2); 
          button.setOnClickListener(new OnClickListener() {
  
          @Override
          public void onClick(View arg0) {
  
          Intent intent = new Intent(context, CustomizedListView.class);
          startActivity(intent);
  
          }
  
  
  
  
  
          });
  
          button2.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View arg0) {
  
              Intent intent = new Intent(context, CustomizedListView.class);
              startActivity(intent);
  
              }
  
  
  
  
  
              });                        
  
  }
  }
  </code></pre>
  
  <p>The problem lies with the ImageView trying to be set by a string ie text2.
  What is the correct way to set the imageview from the url string in text2??
  Thanks in advance!</p>