sergejsha / pinned-section-listview

Easy to use ListView with pinned sections for Android.
2.59k stars 808 forks source link

Use other view instead of TextView may cause problem "Changes made to Items affect other Items" #89

Open spdv123 opened 8 years ago

spdv123 commented 8 years ago

I used a RelativeLayout View contains two TextViews: t1 and t2.When click on one item its t2 will change, however, other items' t2 changed either. I found one solution in "http://stackoverflow.com/questions/36099052/android-listview-changes-made-to-items-affect-other-items" but it didn't work, then I found that it was caused by the function getItemViewType(), so I changed every getItemViewType(XXX) into Item item = (MainActivity.Item)(adapter.getItem(XXX)); int viewType = item.type; and it worked well.