Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
I am working on android. In my page I have radio buttons and I need to get the selected radio button value. My issue is I am able to get the selected radio button value only in that onCheckedChanged method. But when I am trying to print the value outside the onCheckedChanged method it is not printing. How can I get the value outside that method? Please help me out with this. I need the value outside also.
| |||
You can use getCheckedRadioButtonId method of RadioGroup, which will return id of the selected radio Button
Which will return radiobuttonid, if the any of the radiobutton in the RadioGroup is selected, and -1 when NO selection. | |||
make a check whether it is checked get its value. | |||
default
.
stackoverflow.comm
No comments:
Post a Comment