javascript - radio button in android - crashes if none selected -
i use code below in android app check selected radio button in radio group, work crashes if none of radio buttons selected.
how wrap in if statement prevent app crashing?
checkradiobuttonid = genderrd.getcheckedradiobuttonid();// selected radio button radiogroup checkedrbvalue = (radiobutton) findviewbyid(checkradiobuttonid); // find radio button returned id radiobuttontext = checkedrbvalue.gettext().tostring();
thanks.
sorry i'm unable compile right try:
if(checkrbvalue != null){ //enter code here. }
hope helps. :)
Comments
Post a Comment