Using Array Adapter with getview()


setListAdapter(new ArrayAdapter<string>(this, R.layout.list_item, strings) {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View row;
 
if (null == convertView) {
row = mInflater.inflate(R.layout.list_item, null);
} else {
row = convertView;
}
 
TextView tv = (TextView) row.findViewById(android.R.id.text1);
tv.setText(getItem(position));
 
return row;
}
});