title: ListView from XML with custom ImageView
body: <p>I'm populating a layout from an XML. I don't really understand the tutorial so I can only get TextViews populated. How do I dynamically assign an image resource to the ImageView each list item has?</p>
  
  <p>What I'm currently doing:</p>
  
  <pre><code>    ArrayList&lt;HashMap&lt;String, String&gt;&gt; menuItems = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
  
      XMLParser parser = new XMLParser();
      String xml = parser.getXmlFromResource(getApplicationContext(),
              R.raw.symbols);
      Document doc = parser.getDomElement(xml); // getting DOM element
  
      NodeList nl = doc.getElementsByTagName(KEY_SYMBOL);
      // looping through all item nodes &lt;item&gt;
      for (int i = 0; i &lt; nl.getLength(); i++) {
          // creating new HashMap
          HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
          Element e = (Element) nl.item(i);
          // adding each child node to HashMap key =&gt; value
          map.put(KEY_NAME, parser.getValue(e, KEY_NAME));
          map.put(KEY_FILENAME, parser.getValue(e, KEY_FILENAME));
          map.put(KEY_ABBR, parser.getValue(e, KEY_ABBR));
          map.put(KEY_ELEMENT, parser.getValue(e, KEY_ELEMENT));
  
          // adding HashList to ArrayList
          menuItems.add(map);
      }
  
      // Adding menuItems to ListView
      ListAdapter adapter = new SimpleAdapter(this, menuItems,
              R.layout.symbol_list_item, new String[] { KEY_NAME,
                      KEY_FILENAME, KEY_ABBR, KEY_ELEMENT }, new int[] {
                      R.id.name, R.id.filename, R.id.abbr, R.id.element });
  
      setListAdapter(adapter);
  </code></pre>
  
  <p>And if it matters, I'm not simply setting a drawable for an ImageView. I'm using the custom SVGImageView from the androidSVG library. What I have working on a different activity for dynamically pulling the SVG file is this:</p>
  
  <pre><code>symbolImageView = (SVGImageView) findViewById(R.id.symbolImage);
  symbolImageView.setImageResource(this.getResources().getIdentifier(symbol.getFilename(), "raw", this.getPackageName()));
  </code></pre>
  
  <p>And this is what it looks like currently with my placeholder ImageViews:</p>
  
  <p><img src="https://i.stack.imgur.com/xBRn9.png" alt="enter image description here"></p>