title: How to identify the button clicked from a dynamically generated table
body: <p>I am populating a table dynamically from a string array.Each row of the table also has a plus and minus button to increment/decrement the value of one column. These buttons are also dynamically created like in the code below. Here how can I detect the exact button upon clicking. i.e; if I click on the '+' button of the 2nd row, how can I get the id of the button clicked for further processing.</p>
  
  <pre><code> plusButton= new Button(this);
   minusButton= new Button(this);
   createView(tr, tv1, names[i]);
   createView(tr, tv2, (String)(names[i+1]));
   minusButton.setId(i);
   minusButton.setText("-");
   minusButton.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
   plusButton.setId(i);
   plusButton.setText("+");
   plusButton.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));`
  </code></pre>