Created
July 26, 2020 15:45
-
-
Save chelseatroy/49400148fd5132d3189f16f57345f318 to your computer and use it in GitHub Desktop.
Extracting Responses
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
private String extractResponseFor(View view) { | |
RadioGroup options = (RadioGroup) view.findViewById(R.id.radio_group); | |
int selection = options.getCheckedRadioButtonId(); | |
if (selection == -1) { | |
options.setBackgroundColor(getActivity().getResources().getColor(R.color.form_validation)); | |
isFormValid = false; | |
return getString(R.string.unknown); | |
} else { | |
options.setBackgroundColor(0); | |
RadioButton button = (RadioButton) view.findViewById(selection); | |
return button.getText().toString(); | |
} | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment