注意:使用notifyitemremoved(position)更新数据之前,还必须集合中删除该数据:mdatas.remove(position),否则不更新。
这里更新数据集不是用adapter.notifydatasetchanged()而是 notifyiteminserted(position)与notifyitemremoved(position) 否则没有动画效果。
为adapter中添加两个方法:
注意:使用notifyitemremoved(position)更新数据之前,还必须集合中删除该数据:mdatas.remove(position),否则不更新。
这里更新数据集不是用adapter.notifydatasetchanged()而是 notifyiteminserted(position)与notifyitemremoved(position) 否则没有动画效果。
为adapter中添加两个方法: