I had exactly the same problem, and I would suggest (for example, me) that you did not read the documentation when trying to implement this.
I passed an array of arrays to an ArrayAdapter and then passed an array to a super constructor.
I made a mistake: I saved the reference to the passed array and used an array that , to draw the elements in the getView() method:
public SimpleAdapter( Context context, List< MyType > values ) { super( context, R.layout.rowlayout, values ); this.context = context; this.values = values; } @Override public View getView( int position, View convertView, ViewGroup parent ) {
What I have to do is called getItem() in the ArrayAdapter class, for example.
MyType myType = getItem( position );
Which recorded it beautifully and in retrospect is pretty obvious.
- (e)
source share