This code not working , what's Wrong? I don't want to allow user input until radiobutton2
is checked
EditText t4 = (EditText)findViewById(R.id.editText3);
RadioButton rb = (RadioButton) findViewById(R.id.radioButton1);
RadioButton rb2 = (RadioButton) findViewById(R.id.radioButton2);
RadioGroup rg =(RadioGroup) findViewById(R.id.G1);
rg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
if(checkedId==R.id.radioButton1)
{
t4.setEnabled(false);
}
if(checkedId==R.id.radioButton2)
{
t4.setEnabled(true);
}
}
});