title: Difficulty in iterating over an ArrayList of HashMaps
body: <p>I have a globally defined ArrayList as <code>ArrayList&lt;Map&lt;String, String&gt;&gt; mContactList;</code>.  </p>
  
  <p>Now, in one of the methods, I am defining a HashMap like this: </p>
  
  <pre><code>Map&lt;String, String&gt; NamePhoneType = new HashMap&lt;String, String&gt;();    
  NamePhoneType.put("Name", contactName); //contactName is returned from a query
  NamePhoneType.put("Phone", phoneNumber); //phoneNumber is returned from a query
  mContactList.add(NamePhoneType);
  </code></pre>
  
  <p>So <code>mContactList</code> now looks like <code>[{Name=Abc, Phone=123}, {Name=def, Phone=456}...]</code></p>
  
  <p>Now when I try to iterate over the <code>mContactList</code> using the following, I always get the key as <code>'Phone'</code> and Value as <code>'123'</code> or <code>'456'</code> depending on the index.</p>
  
  <pre><code>public void onItemClick(AdapterView&lt;?&gt; av, View v, int index,long arg) {
      Map&lt;String, String&gt; map = (Map&lt;String, String&gt;) av.getItemAtPosition(index);
      Iterator&lt;String&gt; myVeryOwnIterator = map.keySet().iterator();
      while (myVeryOwnIterator.hasNext()) {
          String key = (String) myVeryOwnIterator.next();
          String value = (String) map.get(key);
          getNumber.setText(value);                                    
          }               
      }
  });
  </code></pre>
  
  <p>I want the <code>Name</code> and the <code>Phone</code> of the selected index in 2 separate strings. How do I do that?</p>