xml button link to for loop
<p>I am trying to get a button in an XML doc to add new textfields and checkboxes, I have the for loop that does what I want, but I don't understand how I am suposed to link my button to access a specific part of a java file. </p>

<p>How do i implement?</p>

<p>edit.</p>

<p>Here is my forloop that I want my button to access when pressed (generate textfields)</p>

<p>And Generally I want to know if it is possible to link a xml button to a loop in java and
If not, what can I do in order to get my button to generate textfields?</p>

<pre><code>    for(int i = 0; i &lt;5; i++){
CheckBox cb = new CheckBox(this);
cb.setText("I'm an egg!");
EditText et1 = new EditText(this);
et1.setText("Listitemz!");
ll.addView(et1);
ll.addView(cb);
</code></pre>
