title: How to set the array of checkboxes to checked() in android?
body: <p>I have a array of checkboxes <code>CheckBox labels[] = {fname,lname,company,mobno,workemail,workphone,persemail};</code>   </p>
  
  <p>and I have a radio button. Now what I want is if the user clicks on the radio button, all the check boxes should get checked with the green tick on it. </p>
  
  <pre><code>CheckBox labels[] = {fname,lname,company,mobno,workemail,workphone,persemail};  
      RadioButton available,none,privte,publc;
      //String [] values;
      String firstname2,lastname2,comp2,mobileno2,wrkemail2,wrkphone2,persnalemail2;
  Button generate;
  private String output;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
  
          super.onCreate(savedInstanceState);
          setContentView(R.layout.startnew);
          fname=(CheckBox)findViewById(R.id.fnamechk);
          lname=(CheckBox)findViewById(R.id.lnamechk);
          persemail=(CheckBox)findViewById(R.id.personalemailchk);
          mobno=(CheckBox)findViewById(R.id.cellchk);
          workemail=(CheckBox)findViewById(R.id.Workemailchk);
          company=(CheckBox)findViewById(R.id.companychk);
          workphone=(CheckBox)findViewById(R.id.workphonechk);
  
  available.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  //for(CheckBox cb : labels){ cb.setChecked(true); }
  
              }
          });
  </code></pre>