In my application i used custom list view adapter. In the list view item i added another layout. because in my service one order have any number of order items. For showing
you are using two arrays - "bpData" and "opData" and you only reset if under specific conditions with "opData".
This is a bad design. You need one array - if "opData" is dependent on "bpData" then make it a variable of "bpData".
Or else write something to synchronize the two. Otherwise, you do not know how the display will work.
I had the same issue then below link resolved my problem ;
https://stackoverflow.com/a/36738935/3341089
Basically, you should specify your item types then reconfigure your adapter via getItemViewType(int position)
and getViewTypeCount()
override methods.
If you look into above link, you will get it.
In your adapter class override these two methods
@Override
public int getViewTypeCount() {
return getCount();
}
@Override
public int getItemViewType(int position) {
return position;
}
@Override
public int getViewTypeCount() {
return getCount();
}
@Override
public int getItemViewType(int position) {
return position;
}
Works proper for me