I want to add two list in a single List View. Both with different adapter.
i just found this one but i want something else
how can set two adapter into a list?
i want my list View like this one
is it possible..
I want to add two list in a single List View. Both with different adapter.
i just found this one but i want something else
how can set two adapter into a list?
i want my list View like this one
is it possible..
U need to override getItemViewType and getViewTypeCount.
@Override
public int getViewTypeCount() {
return 2;
}
@Override
public int getItemViewType(int position) {
int type=0;
if(getItem(position).isFolder())
type=1;
else{
type=2;
}
}
And than u inflate your xml files for 2 items. Please review this link.
Add headers in a listView using ArrayAdapter
And also u create common model include to two items.
public class CommonModel
{
private FolderItem folderItem;
private RadioItem radioItem;
//getter and setter
}
For example if myList.get(position).getFolderItem equals null u return song item type and inflate your song view.