title: Android XMLparse to Arraylist
body: <p>Sorry, if I've made things confusing. I edited the whole question. </p>
  
  <p>I'm using XMLPARSER for my urls that is hosted on my webserver. </p>
  
  <p>I would like to parse my url list from <code>url.add(map);</code> into <code>intent.putExtra(Extra.IMAGES, imageUrls);</code> So that i could retrieve urls from my XMLparser. Please guide me how to do it with codes. My attempt shows error </p>
  
  <blockquote>
    <p>java.lang.ArrayStoreException: source[0] of type java.util.HashMap
    cannot be stored in destination array of type java.lang.String[]</p>
  </blockquote>
  
  <pre><code>public class HomeActivity extends BaseActivity {
  
          static final String URL = "http://*******";
  
  
          static final String KEY_LIST = "list";
          static final String KEY_THUMB_URL = "thumb_url";
  
  
  
          @Override
          public void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.ac_home);
  
              ArrayList&lt;HashMap&lt;String, String&gt;&gt; url = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
  
              XMLParser parser = new XMLParser();
              String xml = parser.getXmlFromUrl(URL);
              Document doc = parser.getDomElement(xml); 
              NodeList nl = doc.getElementsByTagName(KEY_LIST);
  
              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_THUMB_URL, parser.getValue(e, KEY_THUMB_URL));
  
                  // adding HashList to ArrayList
                  url.add(map); // &lt;***** Set the results from here to imageUrls
              }
  
          imageUrls = (String[]) url.toArray(new String[0]); // &lt;----***Error****
  
          }
          public void onImageGridClick(View view) {
              Intent intent = new Intent(this, ImageGridActivity.class);
              intent.putExtra(Extra.IMAGES, imageUrls); 
              startActivity(intent);
          }
  
          public void onImagePagerClick(View view) {
              Intent intent = new Intent(this, ImagePagerActivity.class);
              intent.putExtra(Extra.IMAGES, imageUrls);
              startActivity(intent);
          }
  
      }
  </code></pre>