views:

83

answers:

2

i am gettin 1 problem in d android application that i have made.

-> i have a 3 RadioButton's on 1 activity screen

-> after a Button is pressed(on same activity) the text associated with all of them should change and all RadioButton's must be unchecked and should be clickable

the text is changing properly and the RadioButton's are becoming unchecked but the problem am facing is that:

  1. if suppose RadioButton 1 is selected and then after pressing the Button am unable to click that same RadioButton until i click some other RadioButton.

Why so??

A: 

Part1

RadioButton option1  = (RadioButton) findViewById(R.id.RadioButton01);
option1.setText(temp.substring(answerCount[0]+1, answerCount[1]));

if(option1.isChecked())
{
    score+=1;
}

Part2

option1.setChecked(false);
option1.setClickable(true);
option1.setText(temp.substring(answerCount[aCount]+1, answerCount[aCount+1]));

Part 1 is executed Ist and then Part 2 is a part of 1 of my methods.. is that enough??

poojan9118
Why not just edit the original question to include this code?
Amos
no i have found out the error..in my .java i had instances of all radiobuttons but not of radiogroup.once i made RadioGroup instance i called clearCheck() to get rid off the problem..anyways thank you for your kind help
poojan9118
+1  A: 

the solution is for future readers

create RadioGroup instance in .java file and call instance.clearCheck()

poojan9118