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.
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)
intoItem item = (MainActivity.Item)(adapter.getItem(XXX)); int viewType = item.type;
and it worked well.