Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can't pass <code>R.drawable.pic1</code> as a <code>String</code> and then parse it back as an <code>Integer</code>. This will not work, instead simply pass the initial <code>Integer</code> drawable ids directly in the <code>HashMap</code>:</p> <pre><code>List&lt;HashMap&lt;String, Integer&gt;&gt; fillMaps = new ArrayList&lt;HashMap&lt;String, Integer&gt;&gt;(); for(int i = 0; i &lt; eventTitles.length; i++){ HashMap&lt;String, Integer&gt; map = new HashMap&lt;String, Integer&gt;(); map.put("image", clubImages[i]); fillMaps.add(map); } </code></pre> <p>I hope I understand what you want. You could make a class to hold the data that you want to pass in to the adapter, for example:</p> <pre><code>class DataObject { int imageId; String firstString; String secondString; // add here any string that you want to put in your list public DataObject(String firstString, String secondString, int imageId) { this.imageId = imageId; this.firstString = firstString; this.secondString = secondString; } } </code></pre> <p>Then construct the list for the adapter:</p> <pre><code>List&lt;HashMap&lt;String, DataObject&gt;&gt; fillMaps = new ArrayList&lt;HashMap&lt;String, DataObject&gt;&gt;(); for(int i = 0; i &lt; eventTitles.length; i++){ HashMap&lt;String, DataObject&gt; map = new HashMap&lt;String, DataObject&gt;(); map.put("image", new DataObject("First String", "second String", clubImages[i])); fillMaps.add(map); } </code></pre> <p>In the <code>getView()</code> method retrieve the <code>DataObject</code> and use its content data as you please.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload