title: Assigning all check items into a variable
body: <p>Is it possible to assign all the values from checked items in a single variable ? If radio button have this code <code>.getCheckedRadioButtonId()</code>, what about the checkboxes. Here's my xml layout for checkboxes.</p>
  
  <pre><code>&lt;CheckBox
                  android:id="@+id/cbFacilities"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Facility1"
                  android:textColor="#000000"
                  android:textSize="20dp"
                  android:textStyle="bold" /&gt;
              &lt;CheckBox
                  android:id="@+id/cbFacilities2"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Facility2"
                  android:textColor="#000000"
                  android:textSize="20dp"
                  android:textStyle="bold" /&gt;
              &lt;CheckBox
                  android:id="@+id/cbFacilities3"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="Facility3"
                  android:textColor="#000000"
                  android:textSize="20dp"
                  android:textStyle="bold" /&gt;
  </code></pre>
  
  <p>Meaning if I check all items and assign it to variable <code>x</code>. <code>x = Facility1</code> , <code>Facility2</code> and <code>Facility3</code> ?</p>
  
  <pre><code>String rg1 = "*";
                                  String rg2 = "*";
                                  String rg4 = "*";
                                  String rg5 = "*";
                                  theFilter[5] = "0";
                                  if (cbRegAffil.isChecked()) {
                                      int reg = rgRegAffil
                                              .getCheckedRadioButtonId();
                                      RadioButton rBtReg = (RadioButton) dia
                                              .findViewById(reg);
                                      rg1 = (String) rBtReg.getText();
  
                                  }
                                  if (cbAdmin.isChecked()) {
                                      int adm = rgAdmin
                                              .getCheckedRadioButtonId();
                                      RadioButton rBtAdm = (RadioButton) dia
                                              .findViewById(adm);
                                      rg2 = (String) rBtAdm.getText();
                                  }
  
                                  if (cbAmbience.isChecked()) {
                                      int amb = rgAmbience
                                              .getCheckedRadioButtonId();
                                      RadioButton rBtAmbience = (RadioButton) dia
                                              .findViewById(amb);
                                      rg4 = (String) rBtAmbience.getText();
                                  }
                                  if (cbTuition.isChecked()) {
                                      theFilter[5] = spin.getSelectedItem()
                                              .toString();
                                  }
                                  if (cbSpecialty.isChecked()) {
                                      int spec = rgSpecialty
                                              .getCheckedRadioButtonId();
                                      RadioButton rBtSpec= (RadioButton) dia
                                              .findViewById(spec);
                                  //  rg5 = (String) rBtSpec.getText();
  
                                  }
                                  if (cbFacilities.isChecked()||cbFacilities2.isChecked()||cbFacilities3.isChecked()) {
                  //**I want to assign the values checked here with the variable rg5**
                                  } 
  </code></pre>
  
  <p>As you notice Im assigning radiobutton value into a variable, this time in the last part of the program, the value of cbFacilities1-3 if they're checked will assign to a single variable that holds string values.</p>