I want to get the text of rabiobutton
selected by the user. I have 5 radiobutton
within a radiogroup
to then use this field in an Asynctask and insert in a BD. the fact is that I can not get the text.
What I have is the following
radioGroup=(RadioGroup) findViewById(R.id.radiog1);
rbmuybueno=(RadioButton) findViewById(R.id.rbmuybien);
rbbueno=(RadioButton) findViewById(R.id.rbbueno);
rbregular=(RadioButton) findViewById(R.id.rbregular);
rbmalo=(RadioButton) findViewById(R.id.rbmala);
rbmuymalo=(RadioButton)findViewById(R.id.rbmuymala);
public void validarradiobutton(){
if (rbmuybueno.isChecked() || rbbueno.isChecked() || rbmalo.isChecked() || rbregular.isChecked() || rbmuymalo.isChecked())
{
final String pregunta=preguntaa.getText().toString();
}
else
{
final AlertDialog.Builder alertaDeError2 = new AlertDialog.Builder(CalificarEvento.this);
alertaDeError2.setTitle("Advertencia");
alertaDeError2.setMessage("Selecione una alternativa para continuar.");
alertaDeError2.setPositiveButton("Entendido", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
alertaDeError2.create();
alertaDeError2.show();
}
I need to get the text inside the IF and then pass the parameters to the Asynctask