title: Get text of selected checkboxes android?
body: <p>I have 5 checkboxes in my activity xml. I need to get the text of all the selected checkboxes.</p>
  
  <p>One approach is to see if checkbox1 ischecked() and get the text.</p>
  
  <pre><code>    if(checkbox1.isChecked())
         { String text=checkbox1.getText().toString();}
  </code></pre>
  
  <p>and so on.</p>
  
  <p>This becomes quite a lengthy process. </p>
  
  <p>Is there any other approach I can use?</p>