Describe the problem
May I am wrong but as i learned from this tutorial so far, this peace of code looks useless.
Because the "if (checked)" without {} has no function from my point of few
In which lesson and step of the codelab can this issue be found?
04.2 + Task 2 Use radio buttons.
public void onRadioButtonClicked(View view) { // Is the button now checked?
boolean checked = ((RadioButton) view).isChecked();
// Check which radio button was clicked.
switch (view.getId()) {
case R.id.sameday:
if (checked)
// Same day service
displayToast(getString(R.string.same_day_messenger_service));
break;
Describe the problem May I am wrong but as i learned from this tutorial so far, this peace of code looks useless. Because the "if (checked)" without {} has no function from my point of few
In which lesson and step of the codelab can this issue be found? 04.2 + Task 2 Use radio buttons.
public void onRadioButtonClicked(View view) { // Is the button now checked?
boolean checked = ((RadioButton) view).isChecked(); // Check which radio button was clicked. switch (view.getId()) { case R.id.sameday: if (checked) // Same day service displayToast(getString(R.string.same_day_messenger_service)); break;`