Usually you use a string array or list as data for a list of arrays, and the adapter method getItem(position)returns the corresponding string.
But you can use any array of objects or a list as input, and thus pass any data as an element of the list. For instance:
class MyListItem {
private int mId;
private Object mData;
private String mListItemName;
public MyListItem(int id, Object data, String name) {
mId = id;
mData = data;
mListItemName = name;
}
@Override
public String toString() {
return mListItemName;
}
}
You can pass the array to the array MyListItemadapter and use toString()to get the names for the elements. Item data can be obtained with (MyListItem) adapter.getItem(position).