android - RecyclerView and IndexOutOfBoundsException: Invalid index #, size is # -


i have simple recyclerview , want remove items onclick. continuously running crash depending on when clicked on items in list above error. if you're having similar issues, here's how solved it:

public void onbindviewholder(final cardviewholder holder, final int position) 

using position here useful things, if used when removing items list, causing crash, instead using:

holder.getadapterposition(); 

resolved issues immediately.


Comments

Popular posts from this blog

php - Passing multiple values in a url using checkbox -

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -