-1

Inside recyclerview I implement cardview Inside this cardview have 1 edittext, recyclerview contains 10 rows of cardview, but the problem is if I edit 1st row of cardview, it will also reflect in 10th row of cardview editext,if I edit 2nd cardview then it will reflect 9th cardview, what can I do ,please help me out...

2 Answers2

0

Just Override getItemId in your Recycler Adapter.

@Override
public long getItemId(int position) {
    return super.getItemId(position);
}
Ali Babadi
  • 114
  • 9
  • This is not working – Mohammed Afsar Dec 04 '21 at 07:59
  • How can I solve it please give me some solutions, in recyclerview 5 cardview is working correctly whenever I editthe the value and set the value if I add more than 5 then the value from 1 row of cardview is showing in 9th row of cardview..value is showing in both cardview – Mohammed Afsar Dec 04 '21 at 08:28
0

Make sure you're overriding getItemViewType, getItemId and getItemCount properly.

(similar question)

cmak
  • 576
  • 1
  • 4
  • 15