指定位置插入单个数据,更新适配器
public void insertItem(int position, IgQuestionBean igQuestionBean) {
if (igQuestionBeans == null) {
return;
}
notifyItemInserted(position);
igQuestionBeans.add(position, igQuestionBean);
notifyItemRangeChanged(position, getItemCount() - position);
}
删除指定位置数据 更新适配器:
public void deleteItem(int position) {
if (this.igQuestionBeans.isEmpty() || position <= -1) {
return;
}
notifyItemRemoved(position);
this.igQuestionBeans.remove(position);
notifyItemRangeChanged(position, getItemCo