title: sorting a List of Map<String, String>
body: <p>I have a list variable created like this: </p>
  
  <p><code>List&lt;Map&lt;String, String&gt;&gt; list = new ArrayList&lt;Map&lt;String, String&gt;&gt;();</code></p>
  
  <p>In my Android application, this list gets populated.</p>
  
  <p>just an example:</p>
  
  <pre><code>Map&lt;String, String&gt; map1 = new HashMap&lt;String, String&gt;();
  map.put("name", "Josh");
  ...
  
  Map&lt;String, String&gt; map2 = new HashMap&lt;String, String&gt;();
  map.put("name", "Anna");
  ...
  
  Map&lt;String, String&gt; map3 = new HashMap&lt;String, String&gt;();
  map.put("name", "Bernie");
  ...
  
  list.add(map1);
  list.add(map2);
  list.add(map3);
  </code></pre>
  
  <p>I am using <code>list</code> to show results in a <code>ListView</code> by extending <code>BaseAdapter</code> and implementing the various methods.</p>
  
  <p>My problem:  I need to sort <code>list</code> in alphabetical order based on the map's key <strong>name</strong></p>
  
  <p>Question: What is a simple way to sort <code>list</code> in alphabetical order based on the map's key <strong>name</strong>?</p>
  
  <p>I can't seem to wrap my head around this.  I have extracted each <strong>name</strong> from each <code>Map</code> into a <code>String</code> array, and sorted it(<code>Arrays.sort(strArray);</code>).  But that doesn't preserve the other data in each <code>Map</code>, so i'm not too sure how i can preserve the other mapped values</p>