title: How to put all value in arraylist to hashmap in android?
body: <p>I have an ArrayList and I want to put all the array data in my hash map but the problem is all I get is the last index value of the array list.
  <strong>Here's my code</strong></p>
  
  <pre><code>ArrayList&lt;String&gt; imagesFileName = new ArrayList&lt;String&gt;();
  public String[] filename;
  
  public static final String FILE_NAME = "filename";
  public static final String DESCRIPTION = "filename1";
  public static final String UPLOADEDBY = "filename2";
  public static final String DATE_UPLOAD = "filename3";
  public static final String ACTION = "filename4";
  public static final String ID = "1";
  ArrayList&lt;HashMap&lt;String, String&gt;&gt; mylist;
  
     filename = new String[imagesFileName.size()];
       for (int i = 0; i &lt; imagesFileName.size(); i++) {
           filename[i] = imagesFileName.get(i);
      }
  
  
           mylist = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
           HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
           for (int i = 0; i &lt; imagesFileName.size(); i++) {
              map.put(FILE_NAME, filename[i]);
              map.put(DESCRIPTION, "desc");
              map.put(UPLOADEDBY, "uploadby");
              map.put(DATE_UPLOAD, "date_upload");
              map.put(ACTION, "delete");
              map.put(ID, "1");
              mylist.add(map);
      }
  
  
       adapter = new CustomArrayAdapter(getApplicationContext(), mylist, R.layout.attribute_ireport_list, 
               new String[]{FILE_NAME, DESCRIPTION, UPLOADEDBY, DATE_UPLOAD, ACTION, ID},
               new int[]{R.id.tv_File, R.id.txt_Desc, R.id.tv_UploadedBy, R.id.tv_DateUploaded, R.id.tv_Action, R.id.txt_id}, true);
  
          lv_iReport.setAdapter(adapter);
  </code></pre>