I have a list view with 20 rows and I want to setup a horizontal scrollview
for every row item in list view, as each row contains more than one item.
He
The problem is with your adapter as:
getCount()
from your adapter must return the total number from list. Returning 20
is not valid in your context - and you seem to have 20 items in your list. You should return dataSet.size();
getItem()
should return the item from the model data structure, in this case:Below
@Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return dataSet.get(position);
}
Also, your getView
method must return the view that displays the model data at given at position
parameter. Returning a ViewGroup
with non-meaningfull dummy data is what you currently have. You should get the ArrayList
from parameter position (through dataSet.get(position)
) and construct/inflate a View that displays properly this data structure item.