Read the explanation about super.
Calling super.getItemId(position)
will call the getItemId method in the Recyclerview
adapter class which will return -1
as
/**
* Return the stable ID for the item at <code>position</code>. If {@link #hasStableIds()}
* would return false this method should return {@link #NO_ID}. The default implementation
* of this method returns {@link #NO_ID}.
*
* @param position Adapter position to query
* @return the stable ID of the item at position
*/
public long getItemId(int position) {
return NO_ID;
}
so you must override
getItemId
method to send unique int
ID(like return position
) which will be used to find holders, children etc for animation, holder reusability and often during testing etc.