title: Nested HashMap Creation in Android
body: <p>In my application I have 3 tabs that contain ListViews depending on what the selection was in the previous tabs. Basically, the 1st tab will list restaurants, 2nd tab will lists submenus of the selected restaurant, the 3rd menu will lists the items of that selected submenu, and then when an item is selected, it will display some nutritional info about that item. I don't know the best way to organize the restaurants/submenus/item, but the way I was thinking was a nested HashMap like the following.</p>
  
  <pre><code>HashMap&lt;String, HashMap&lt;String, HashMap&lt;String, Double[]&gt;&gt;&gt;
  </code></pre>
  
  <p>What I don't know how to do, is efficiently build this map where it is easy to add/remove things in the future. I was looking at xml, but I could not figure out how to do it. If I did it this way, I would also need help writing the Java code to parse through the xml and put it all into the correct place in its map. I am not sure if you need to use tags or if you can just have an xml file that utilizes map and then just kind of 'import' it into your java project. I don't think that hard coding every single item in Java would be very efficient, so I was hoping I could get some help.</p>
  
  <p>Possble, like this? Not exactly filled out, but I really didn't know what I was doing.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;util:map name="foodmapping"&gt;
   &lt;restaurant key="McDonalds"&gt;
    &lt;util:map&gt;
  
    &lt;/util:map&gt;"
  
   &lt;/restaurant&gt;
   &lt;restaurant key="Starbucks"&gt;
    &lt;value&gt;2
    &lt;/value&gt;
   &lt;/restaurant&gt;
  &lt;/util:map&gt;
  </code></pre>