@Override public void onCheckedChanged(RadioGroup rg, int checkedId) { if (modifyingRadioButtons) { return; } modifyingRadioButtons = true; RadioGroup teamARG = (RadioGroup) findViewById(R.id.teamaradiogroup); RadioGroup teamBRG = (RadioGroup) findViewById(R.id.teambradiogroup); RadioButton teamARB = (RadioButton) findViewById(teamARG.getCheckedRadioButtonId()); RadioButton teamBRB = (RadioButton) findViewById(teamBRG.getCheckedRadioButtonId()); int aPoints = Integer.parseInt(teamARB.getText().toString()); int bPoints = Integer.parseInt(teamBRB.getText().toString()); // somebody needs to be reset to 0 if ((aPoints > 0 && bPoints > 0) || (aPoints < 0 && bPoints < 0)) { // team A was clicked, so team B should reset if (rg.equals(teamARG)) { bPoints = 0; ((RadioButton) findViewById(R.id.teambradio0)).setChecked(true); } // team B was clicked, so team A should reset else { aPoints = 0; ((RadioButton) findViewById(R.id.teamaradio0)).setChecked(true); } } if (aPoints > 0 || bPoints > 0) { enableBonusBoxes(); } else { clearBonusBoxes(); disableBonusBoxes(); } Tossup oldTossup = game.currTossup(); Tossup t; if (aPoints >= bPoints) { t = new Tossup( game.getCurrTossupNum(), game.getTeamA(), aPoints, game.getTeamB(), bPoints, oldTossup.isTiebreaker()); } else { t = new Tossup( game.getCurrTossupNum(), game.getTeamB(), bPoints, game.getTeamA(), aPoints, oldTossup.isTiebreaker()); } game.updateCurrTossup(t); updateGlobalScore(); updatePlayerSpinner(); updateBonusBoxes(t); modifyingRadioButtons = false; }