I\'m having a problem with using the notifyItemMoved()
method. It seems to be incorrectly displaying unmoved views.
My list has 4 element in it. What I w
To get the actual position of your item after a drag&drop, add this method to your adapter:
private int getItemPosition(Item item){ // (<-- replace with your item)
int i = 0;
// (replace with your items and methods here)
for (Item currentItem : mItems) {
if (currentItem.getItemId() == item.getItemId()) break;
i++;
}
return i;
}
and call this instead of the position given by the viewHolder.