title: How to declare an array of checkboxes in android
body: <p>I have googled this question but cannot find a simple or specific enough answer to it:
  Could any experienced programmer help me...?</p>
  
  <p>I have an array of 10 checkboxes in a custom dialog called dialog1.</p>
  
  <pre><code>public class DigitsActivity extends Activity {
  ...
  CheckBox[] ckbDigits = new CheckBox[10];
  ...
  
  
  public void SelectDigit1(){  // method which opens the custom dialog
  
  Context context=DigitsActivity.this;
  final Dialog dialog1 = new Dialog(context);
  ...
  for (int k = 0; k &lt;= 9; k++){
    ckbDigits[k] = (CheckBox) dialog1.findViewById(R.id.ckbDigits[k]);
  }
  ...
  }
  </code></pre>
  
  <p>I am getting multiple errors at the line</p>
  
  <pre><code>ckbDigits[k] = ...
  </code></pre>
  
  <p>I tried also :</p>
  
  <pre><code>ckbDigits[] = (CheckBox) dialog1.findViewById(R.id.ckbDigits[]);
  </code></pre>
  
  <p>but it doesn't work either...</p>
  
  <p>Could anybody tell me how to declare an array of checkboxes ?</p>
  
  <p>Thanks.</p>