I have 3 questions
private static int NUMBER_OF_QUESTIONS = 3;
static boolean[] answer = new boolean[NUMBER_OF_QUESTIONS];
static boolean[] checked = new boolea
Where are you updating isAnswered array. In the code snippet you have provided, it updates only answer and checked arrays.
Probably that is why you are always getting false for all 3 array elements of isAnswered array.
Where are you updating isAnswered array. In the code snippet you have provided, it updates only answer and checked arrays.
Probably that is why you are always getting false for all 3 array elements of isAnswered array.
Hi Roman,
I believe you have multiple radio groups each with 3 radio buttons. If that is the case, just slight modification in you above code snippet should work for you.
rg1.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
if (checkedId == R.id.radioButton1) {
Toast.makeText(getActivity(), "True", Toast.LENGTH_SHORT).show();
checked[0] = true;
answer[0] = true;
} else {
checked[0] = true;
answer[0] = false;
}
// update isAnswered[0] to true. as this gets invoked when you choose any radio button.
isAnswered[0] = true;
}
});
Please let me know if this helps.