How to manage onclick on dyanamically generated checkbox in android
<p>I have created multiple checkboxes via applying looping.</p>

<pre><code>for(int l=0;l&lt;len;l++)
{
chkBox = dynamicUiComponents.myCheckBox(context, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT), 100+i, "Unchecked", opts[l]);
myLayout.addView(chkBox);
}
</code></pre>

<p>All the check boxes are showing. But when I am applying setOnCheckedChangeListener(l) on that check box, then only last added check box text is printer. Its because every time in loop, I provide a new object reference to the chkBox variable. So here how to identify that which chechbox is clicked.</p>
