How to get value in an array list from Textview and radio button in RecyclerView on click button
when clicking on button then store in an array list please help me
How to get value in an array list from Textview and radio button in RecyclerView on click button
when clicking on button then store in an array list please help me
Question is not clear. From where you want to store a data as an array ? From checkbox and where is your text - is it question of your text or what ? Pal, if you want to collect data from check box then you can use onCheckChangeListener
.
On this .
final List<String> mList = new ArrayList<>();
mList.add("Your value");
I guess your button is in Fragment
(or Activity
) and your radio button is in an item of RecyclerView
.
You can do like
If your RecyclerView is recyclable
setOnCheckedChangeListener
list
, map
, or any other datatype you like)adapter.
If your RecyclerView is not recyclable
You don't need to save any value.
When click at Button
, you can get RecyclerView
item -> then get RadioGroup
-> get selected RadioButton.