I have 3 questions
private static int NUMBER_OF_QUESTIONS = 3;
static boolean[] answer = new boolean[NUMBER_OF_QUESTIONS];
static boolean[] checked = new boolea
Try this:
static boolean[] isAnswered = new boolean[NUMBER_OF_QUESTIONS]; // initially all false
.............
....................
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 value as user selected radio button
isAnswered[0] = true;
}
});
Do same for your other RadioGroups
(rg2, rg3, ......
). Hope this will help~