Selecting one RadioButton value and scrolling back removing the selected one in RecyclerView

后端 未结 9 1899
温柔的废话
温柔的废话 2020-12-15 18:24

In my application am displaying 20 multiple choice questions with the help of RecyclerView.

If I change the value of first RadioGroup and s

9条回答
  •  盖世英雄少女心
    2020-12-15 19:07

    RecyclerView came over ListView and its major property that is It Reuses cells while scrolling up and down. Due to this it do not flick while scrolling even if you have lots of data in your list. You are getting problem due to Reuse of cells in RecyclerView.

    You can overcome to this problem by binding your RecyclerView list data to Modal class with getter and setter method. You can display checkbox checked or unchecked on basis of cell position and corresponding data. In my sample i used setOnClickListener instead of setOnCheckedChangeListenerto to show checkbox checked or unchecked.

提交回复
热议问题