Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>if (radio1.isChecked() || radio2.isChecked() || radio3.isChecked()) { //Do something here. } </code></pre> <p>The above if you want to check if <em>any one</em> of the radio buttons is checked. </p> <pre><code>if (radio1.isChecked() &amp;&amp; radio2.isChecked() &amp;&amp; radio3.isChecked()) { //Do something here. } </code></pre> <p>The above if you want to check if <em>all</em> the radio buttons are checked. </p> <p>If I understand you correctly, you also want to check some btnChk's click, before you press NEXT. So put a FLAG (Global Variable) in your btnChk's onClick method, if you want to log that if that particular button was presed. </p> <p>If you want anyone of the radio button checks to be true, use the || condition in the if statement. Then to check if btnChk was pressed do the following: </p> <p>Declare a Global FLAG at just below the class declaration: </p> <pre><code>public int FLAG = 0; </code></pre> <p>Set a buttonclick event on your button in onCreate():</p> <pre><code>Button btnChk = (Button)findViewById(R.id.YourId); btnChk.setOnClickListener(btn); private View.OnClickListener btn = new View.OnClickListener() { @Override public void onClick(View v) { FLAG =1; } }; </code></pre> <p>Then in your NEXT button check the following: </p> <pre><code>if (radio1.isChecked() || radio2.isChecked() || radio3.isChecked()) { if(FLAG ==1){ //Do something here. } } </code></pre> <p>What the FLAG does: FLAG is init to zero initially, as soon as you press btnChk, FLAG becomes 1, if btnChk is not pressed, FLAG remains 0. so in the button click of Next button you check the value of FLAG and do your stuff accordingly. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload