I am doing a survey project which implements many RadioButton
. Within this project I am implementing a functionality that retrieves the status of the interface using SQLite database, so I need to select RadioButton
with respect to what was recorded. By this I mean:
If I have 100 Radiobutton they have a name like this:
(Radio_1, Radio_2, Radio_3, Radio_4, Radio_5.......Radio_100);
If I want to change the status of each one, I would do it in the following way:
findViewById(R.id.Radio_1).setChecked(true);
findViewById(R.id.Radio_2).setChecked(true);
findViewById(R.id.Radio_3).setChecked(true);
.
.
.
.
findViewById(R.id.Radio_100).setChecked(true);
But, is there any way to put this in a For cycle? So the code would be much more effective