Setting the text to checkbox dynamically in android
<p>I need to create checkboxes dynamically in android. I am getting the value in my code but unable to set that value to checkbox.</p>

<p>My Code:</p>

<pre><code>CheckBox[] cbs = new CheckBox[20]; 
for(int k=0; k&lt;stringList3.size(); k++)
{
 System.out.println("stringlist3 in for loop"+stringList3.get(0));
 arr = stringList3.get(k);
 cbs[k] = new CheckBox(getContext());
 System.out.println("arr values"+arr.get(0));
 System.out.println("arr values"+arr.get(1));
 System.out.println("arr values"+arr.get(2));
 cbs[k].setText((CharSequence) arr.get(2));
 Rl.addView(cbs[k]);
                 } 
</code></pre>

<p>Here when I am setting the value arr.get(2) to checkbox it is not setting ...please help me regarding this...
Thanks in advance</p>
