I want to display the arrayList items in ListView which is having 2 different textViews. I am using ListViewCustomAdapter and getView(),getItem()... methods are there.
Its clear from your question that you want to display [a1, a2, b1, b2, c1, c2...] as
a1a2
b1b2
c1c2
so you need to change your code to following:
@Override
public int getCount() {
// TODO Auto-generated method stub
if(myList.size()%2==0)
return mylist.size()/2;
else
return myList.size()/2+1;
}
and getView method as below:
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
View List;
if(convertView==null)
{
List=new View(context);
LayoutInflater mLayoutinflater=(LayoutInflater)context.getSystemService(context.LAYOUT_INFLATER_SERVICE);
List=mLayoutinflater.inflate(R.layout.listitem_row, parent, false);
}
else
{
List=(View)convertView;
}
TextView t1=(TextView)List.findViewById(R.id.txtViewTitle);
t1.setText((CharSequence) mylist.get(position*2));
TextView t2=(TextView)List.findViewById(R.id.txtViewDescription);
if(position*2