Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if "Radiobutton" is checked?

I would like to make a structure with the condition (if-else) RadioButton

I want that when the Radiobutton RB1 is selected, this function is active:

regAuxiliar = ultimoRegistro;

And when the radiobutton RB2 is selected, this function is active:

regAuxiliar = objRegistro;

And sorry for my English, I'm Brazilian.

like image 347
Ricardo Potozky de Oliveira Avatar asked Jun 15 '12 11:06

Ricardo Potozky de Oliveira


1 Answers

radiobuttonObj.isChecked() will give you boolean

if(radiobuttonObj1.isChecked()){
//do what you want 
}else if(radiobuttonObj2.isChecked()){
//do what you want 
}
like image 50
Dheeresh Singh Avatar answered Nov 01 '22 10:11

Dheeresh Singh