Issue
I'm making an Android app as part of my University project, and I want to know how do I get the Radio Button Id (int value) if I have its resource name as a string, which I get as follows:
String resName = getResources()
.getResourceEntryName(optionGroup.getCheckedRadioButtonId());
Its because when a user returns back to this activity, his previously selected radio button has to be shown, using the check() method like this:
optionGroup.check(rBtnId);
I did think about storing the Radio Button Id itself, but I need the string value elsewhere in the app, and require the int Id only here. Any help is appreciated.
Solution
You can use this:
Answered By - hmartinezd
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.