I have a problem with RecyclerView
, I have RecyclerView
which has a radio button
and few other views in each row item,
What I wanted exactly is, when a RadioButton
is checked by user I want to uncheck other RadioButton
(if anything is checked earlier). Since it is a Recyclerview
I cannot use radiogroup.
In the adapter onBindViewHolder
I write this listener for each radio button
holder.radioButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
selectedPosition = holder.getAdapterPosition();
Toast.makeText(activity, "section: " + selectedPosition, Toast.LENGTH_SHORT).show();
}
});
how can i make previous radio button selected uncheck?
in other words, how can i update view property in specific item of recyclerview from another item view listener?