In android, I usually use MyAdapter extends ArrayAdapter to create view for the ListView, and as a result, I have to override the function
public View getView(int position, View convertView, ViewGroup parent) {
// somecode here
}
However, i don’t know exactly what convertView and parent do! Does anyone have a suggestion? More detail, more help! Thanks!
From the documentation,
In other words, this parameter is used strictly to increase the performance of your
Adapter. When aListViewuses anAdapterto fill its rows withViews, the adapter populates each list item with aViewobject by callinggetView()on each row. The Adapter uses theconvertViewas a way of recycling oldViewobjects that are no longer being used. In this way, theListViewcan send the Adapter old, “recycled” view objects that are no longer being displayed instead of instantiating an entirely new object each time the Adapter wants to display a new list item. This is the purpose of theconvertViewparameter.