title: Getting multiple value of checked check boxes in an array
body: <p>I have created check boxes programmatically. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>            llmain = (LinearLayout) findViewById(R.id.linearLayoutMain);
              lLayout = new LinearLayout[b];
              for (int j = 0; j &lt; b; j++) {
                  int x = 0;
                  x = x + (j * 5);
                  lLayout[j] = new LinearLayout(CheckBoxdemo.this);
                  lLayout[j].setLayoutParams(new LayoutParams(
                          LayoutParams.WRAP_CONTENT,
                          LayoutParams.WRAP_CONTENT));
                  lLayout[j].setOrientation(LinearLayout.VERTICAL);
                  llmain.addView(lLayout[j]);
                  for (int i = x; i &lt; x + 5; i++) {
                      if (x &gt; a) {
                          break;
                      } else {
                          if (testArrayList.contains(idsplit[i])) {
                              cb = new CheckBox(CheckBoxdemo.this);
                              cb.setText(namesplit[i]);
                              cb.setId(i + 1);
                              cb.setChecked(true);
                              cb.setTextColor(Color.BLACK);
                              cb.setTextSize(12f);
                              cb.setButtonDrawable(R.drawable.checkbox);
                              cb.setPadding(35, 5, 25, 5);
                              cb.setTag(i + 1);
                              cb.setOnCheckedChangeListener(handleCheck(cb));
                              if ((count1.equals(1)) || (count1.equals(2))) {
                                  cb.setEnabled(true);
                              } else {
                                  cb.setEnabled(false);
                              }
                              lLayout[j].addView(cb);
                          } else {
                              cb = new CheckBox(CheckBoxdemo.this);
                              cb.setText(namesplit[i]);
                              cb.setId(i + 1);
                              cb.setTextColor(Color.BLACK);
                              cb.setTextSize(12f);
                              cb.setButtonDrawable(R.drawable.checkbox);
                              cb.setPadding(35, 5, 25, 5);
                              cb.setTag(i + 1);
                              cb.setOnCheckedChangeListener(handleCheck(cb));
                              if ((count1.equals(1)) || (count1.equals(2))) {
                                  cb.setEnabled(true);
                              } else {
                                  cb.setEnabled(false);
                              }
                              lLayout[j].addView(cb);
                          }
                      }
                  }
              }
  </code></pre>
  
  <ul>
  <li>Now I have received value of 15 check boxes from the database. </li>
  </ul>
  
  <p>Now, all the check boxes are non- selected. If I click on any 5 of them; then I want to get the value of these 5- selected check boxes all together in an array, on just a click of a button.</p>
  
  <p>How can I implement this???????</p>