Checkbox selectAll\DeselectAll in tableLayout
<p>I have List of route in tablelayout.
CheckBox &amp; TextView created dynamically.
I set the checkbox id.</p>

<p>I want to do the selectall &amp; deselectAll . How we can implement?</p>

<p>I created checkBox using coding.then How can call this <code>CheckBox cb = (CheckBox)view.findViewById(R.id.????);</code></p>

<pre><code> tl = (TableLayout) findViewById(R.id.dailyDRoute);
    ArrayList&lt;SalesRoutes&gt; routeList = getSalesRoute();
    for (int i = 0; i &lt; routeList.size(); i++) {
        TableRow tr = new TableRow(this);
        CheckBox ch = new CheckBox(this);
        ch.setHeight(1);
        ch.setId(i);
        TextView tv2 = new TextView(this);
        tr.addView(ch);
        tv2.setText(routeList.get(i).getDescription());
        tv2.setTextColor(Color.BLACK);

        tr.addView(tv2); 
        tl.addView(tr);
    }
}


 public void deselectAll(View view){
    // CheckBox cb = (CheckBox)view.findViewById(R.id.);

 }


 public void selectAll(View view){

 }
</code></pre>

<p><img src="http://i.stack.imgur.com/BvvE3.png" alt="enter image description here"></p>

<p>Please help me ...</p>

<p>Thanks in advance..</p>
