Deprecated getChildPosition() in recyclerview in android-ThrowExceptions

Exception or error:

Deprecated method: getChildPosition() method in recyclerview has been deprecated.
What is alternate of this ?

How to solve:

getChildPosition method is deprecated.
you can use getChildAdapterPosition(View) or getChildLayoutPosition(View).


You can use

int position = getAdapterPosition();

Leave a Reply

Your email address will not be published. Required fields are marked *