Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From the <a href="http://developer.android.com/reference/android/widget/ExpandableListAdapter.html" rel="nofollow">API reference</a> of <code>ExpandableListAdapter</code>:</p> <pre><code>getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent): Gets a View that displays the data for the given child within the given group. </code></pre> <p>This is the method that returns the <code>View</code> of the child, which means you could write something like this in your <code>ExpandableListAdapter</code>:</p> <pre><code>@Override public View getChildView(int gPos, int cPos, bool isLast, View view, ViewGroup parent){ if (view == null){ view = inflater.inflate(R.layout.whatever, null); } ImageView image = (ImageView) view.findViewById(R.id.image); // This next part depends on how you store the images. // You could store the imageID in an int[][]: int imageID = carImages[gPos][cPos]; image.setImageResource(imageID); // or you could store the drawable in a List&lt;List&lt;Drawable&gt;&gt; Drawable d = carimages.get(gPos).get(cPos); iamge.setImageDrawable(d); // etc. return view; } </code></pre> <p>The point is that you have to store the images in a way that you can retreive the right image by providing which index the view has, and in which group it is in. You could also store the image in a <code>CarObject</code>, and have a <code>List&lt;CarObject&gt;</code> in your adapter. But you would have to find a way to distinguish between the different brands.</p>
    singulars
    1. This table or related slice is empty.
    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. This table or related slice is empty.
    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