title: Get a Map from an ArrayList of Map in Java for Android
body: <p>I'm developing an app for Android. My app parse an XML remote file and I store the data for the first tag in an ArraList of Maps and the data of the second tag in another ArrayList of Maps.
  I will post here my XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Programs&gt;
      &lt;Program programNumber="1" imgURL="http://www.photovideolife.com/userfiles/Placeholder%2001.jpg" description="Lorem ipsum dolor sit er elit"&gt;
          &lt;Episode pN="1" episodeNumber="1" transmissionName="Titolo" date="29 Giu 2013" time1="14:30" time2="" channel="IRIS" channelLogo="http://indiscrezioni.files.wordpress.com/2010/06/logo_iris.jpg"&gt;
          &lt;/Episode&gt;
          &lt;Episode pN="1" episodeNumber="1" transmissionName="Titolo" date="29 Giu 2013" time1="" time2="16:30" channel="La7" channelLogo="http://www.tabaccheriavenza.it/media/logo/la7.jpg"&gt;
          &lt;/Episode&gt;
          &lt;Episode pN="1" episodeNumber="2" transmissionName="Titolo" date="01 Lug 2013" time1="14:30" time2="" channel="IRIS" channelLogo="http://indiscrezioni.files.wordpress.com/2010/06/logo_iris.jpg"&gt;
          &lt;/Episode&gt;
          &lt;Episode pN="1" episodeNumber="2" transmissionName="Titolo" date="01 Lug 2013" time1="" time2="16:30" channel="la7" channelLogo="http://www.tabaccheriavenza.it/media/logo/la7.jpg"&gt;
          &lt;/Episode&gt;
      &lt;/Program&gt;
      &lt;Program programNumber="2" imgURL="http://mesa.umich.edu/files/mesa/field/image/placeholder2.png" description="Lorem ipsum dolor sit er elit"&gt;
          &lt;Episode pN="2" episodeNumber="1" transmissionName="Titolo 1" date="30 Giu 2013" time1="13:30" time2="" channel="Rai 1" channelLogo="http://i822.photobucket.com/albums/zz145/Mattelufregn/Loghi%20canali%20tv/70px-Logo_Rai_1_2010svg50x50.png"&gt;
          &lt;/Episode&gt;
          &lt;Episode pN="2" episodeNumber="1" transmissionName="Titolo 1" date="30 Giu 2013" time1="" time2="18:30" channel="Rai 5" channelLogo="http://www.tuttotv.info/wp-content/uploads/2011/04/logo_rai5_50.jpg"&gt;
          &lt;/Episode&gt;
          &lt;Episode pN="2" episodeNumber="2" transmissionName="Titolo 1" date="01 Lug 2013" time1="13:30" time2="" channel="Rai 1" channelLogo="http://i822.photobucket.com/albums/zz145/Mattelufregn/Loghi%20canali%20tv/70px-Logo_Rai_1_2010svg50x50.png"&gt;
          &lt;/Episode&gt;
          &lt;Episode pN="2" episodeNumber="2" transmissionName="Titolo 1" date="01 Lug 2013" time1="" time2="18:30" channel="Rai 5" channelLogo="http://www.tuttotv.info/wp-content/uploads/2011/04/logo_rai5_50.jpg"&gt;
          &lt;/Episode&gt;
      &lt;/Program&gt;
      &lt;Program programNumber="3" imgURL="http://wp.contempographicdesign.com/wp_paramount/wp-content/themes/paramount/images/image_placeholder_lrg.jpg" description="Lorem ipsum dolor sit er elit"&gt;
          &lt;Episode pN="3" episodeNumber="1" transmissionName="Titolo 2" date="30 Giu 2013" time1="10:30" time2="" channel="Canale 5" channelLogo="http://www.mozaic.qa/logo/canale5.jpg"&gt;
          &lt;/Episode&gt;
          &lt;Episode pN="3" episodeNumber="1" transmissionName="Titolo 2" date="30 Giu 2013" time1="" time2="17:30" channel="Italia 1" channelLogo="http://upload.wikimedia.org/wikipedia/it/thumb/3/30/Logo_Italia_1.svg/50px-Logo_Italia_1.svg.png"&gt;
          &lt;/Episode&gt;
          &lt;Episode pN="3" episodeNumber="2" transmissionName="Titolo 2" date="01 Lug 2013" time1="10:30" time2="" channel="Canale 5" channelLogo="http://www.mozaic.qa/logo/canale5.jpg"&gt;
          &lt;/Episode&gt;
          &lt;Episode pN="3" episodeNumber="2" transmissionName="Titolo 2" date="01 Lug 2013" time1="" time2="17:30" channel="Italia 1" channelLogo="http://upload.wikimedia.org/wikipedia/it/thumb/3/30/Logo_Italia_1.svg/50px-Logo_Italia_1.svg.png"&gt;
          &lt;/Episode&gt;
      &lt;/Program&gt;
  &lt;/Programs&gt;
  </code></pre>
  
  <p>At the end of parsing I've an ArrayList for programs and an ArrayList for Episode. You can see that Programs and Episode have a common field (programNumber and pN), now I need to take the data stored in ArrayList of Episode for the right program.
  How I can do that?
  I found on the web this solution:</p>
  
  <pre><code>for (HashMap&lt;String, String&gt; programsMap : programs) {
      for (Map.Entry&lt;String, String&gt; entry : programsMap.entrySet()) {
     // I added some code here
    }
  }
  </code></pre>
  
  <p>How I can solve this problem?
  Thank you for the suggestion.</p>