I went through tutorials and searched, but still I can't understand how the,
getView(int position, View convertView, ViewGroup arg2)
method works when extends BaseAdapter
to create a custom listView in my android application. Therefore I cant Edit the Custom list view exactly I want.
I need to know when this method invokes and the meanings of the parameters.
If someone can explain the following method its great. Thanks
@Override
public View getView(int position, View convertView, ViewGroup arg2)
{
ViewHolder holder;
LayoutInflater inflater = context.getLayoutInflater();
if (convertView == null)
{
convertView = inflater.inflate(R.layout.listitem_row, null);
holder = new ViewHolder();
holder.txtViewTitle = (TextView) convertView.findViewById(R.id.textView1);
holder.txtViewDescription = (TextView) convertView.findViewById(R.id.textView2);
convertView.setTag(holder);
}
else
{
holder = (ViewHolder) convertView.getTag();
}
holder.txtViewTitle.setText(title[position]);
holder.txtViewDescription.setText(description[position]);
return convertView;
}