I have the function that display a RingTone list from User's phone as a RadioGroup inside RecyclerView
The RadioGroup's size increase dynamically as the size of user's phone
Everything work perfectly except when user select a ringtone, click save and then go back again, it doesn't show the Ringtone that has been selected
How can I get the index/id of the radio button from a dynamic RadioGroup?
Asked
Active
Viewed 50 times
0

Đoàn Trung Hiếu
- 23
- 1
- 6
-
2Can you add a Minimal, Complete, and Verifiable example, see https://stackoverflow.com/help/mcve ? Otherwise it is hard to tell what is going wrong ... – quant Nov 01 '18 at 08:39
-
Possible duplicate of [How to get the selected index of a RadioGroup in Android](https://stackoverflow.com/questions/6440259/how-to-get-the-selected-index-of-a-radiogroup-in-android) – Shahab Rauf Nov 01 '18 at 08:45
1 Answers
1
on that radiobutton listener like oncheckedchangelistener get it's id and save it. After that when screen's oncreate fetch that id and set selected.
One more thing in model class set one boolean variable which define radio button checked or not.

Parth Suthar
- 123
- 4