I have a delete button in each item of RecyclerView
. It works fine but the view
below RecyclerView
doesn't follow up.
I try to follow Android RecyclerView addition & removal of items but it still not works
Here my code
public ViewHolder(View itemView) {
super(itemView);
btnDelete = (ImageButton)itemView.findViewById(R.id.detail_delete);
btnDelete.setOnClickListener(this);
}
@Override
public void onClick(View v) {
removeAt(getAdapterPosition());
}
private void removeAt(int position) {
scheduleList.remove(position);
notifyItemRemoved(position);
notifyItemRangeChanged(position, scheduleList.size());
}