Stuck at the java code Android Studio : <p>i'm making a sample quiz app with yes no questions, my xml is already done, but i'm really stuck with the java part. i need to display a toast when i click the button, so i can say: you like your phone brand, and when is negative i need to show a toast saying: you don't like your phone brand much. i have all the checkboxes wit ids but i'm really confused now... thanks in advance for the precious help, i appreciate it!</p>

<p>This is the java code</p>

<pre><code> @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}

//This is called when tapping the button

public void showResult(View view) {

    CheckBox firstCheckbox = (CheckBox) findViewById(R.id.yes_One);
    boolean isYes = firstCheckbox.isChecked();

    CheckBox firstNCheckbox = (CheckBox) findViewById(R.id.no_One);
    boolean isNo = firstNCheckbox.isChecked();

    CheckBox secondCheckbox = (CheckBox) findViewById(R.id.yes_Two);
    boolean isYesTwo = secondCheckbox.isChecked();

    CheckBox secondNCheckbox = (CheckBox) findViewById(R.id.no_Two);
    boolean isNoTwo = secondNCheckbox.isChecked();

    CheckBox thirdCheckbox = (CheckBox) findViewById(R.id.yes_Three);
    boolean isYesthree = thirdCheckbox.isChecked();

    CheckBox thirdNCheckbox = (CheckBox) findViewById(R.id.no_Three);
    boolean isNoThree = thirdNCheckbox.isChecked();

    CheckBox fourthCheckbox = (CheckBox) findViewById(R.id.yes_Four);
    boolean isYesFour = fourthCheckbox.isChecked();

    CheckBox fourthNCheckbox = (CheckBox) findViewById(R.id.no_Four);
    boolean isNoFour = fourthNCheckbox.isChecked();
}
</code></pre>

<p>}</p>
