android - getCheckedRadioButtonId() of RadioGroup returns 2131034181/2/3/4 -
As part of my application, I have to create four radio buttons in a radiogram and click on the radio button. I wrote the following code but my selection id attribute gives value 2131034181 when the first option is selected and 2131034182 when the second option is selected and likewise, when 3 and 4 are clicked, the change in the unit number of the value it happens. Why is it like this?
int selectId = rbg.getCheckedRadioButtonId (); Radio button selected = (radio button) rbg.findViewById (selectId); String selected_user = (string) selected .gettext (); To get
Radoboton
, click < Code> findViewById instead of radiogram
, then replace
radio button selected = (radio button) rbg.findViewById ( SelectId); String selected_user = (string) selected .gettext ();
to
selected radio button = (radio button) searchWBIID (selection ID); String selected_user = selected.getText (). ToString ();
Comments
Post a Comment