title: How can I get the value from TextView with OnClickListener?
body: <p>I have this code to create a dynamic table.
  Now I want to attach to every TextView an event at onClick. When I tap on a TextView, I want to get the value and execute a method.
  So this is my code:</p>
  
  <pre><code>                TableLayout ll=(TableLayout) view.findViewById(R.id.displayLinear);  
  
                  TableRow.LayoutParams rowParams = 
                          new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, 0, 1f);
  
                  TableRow.LayoutParams itemParams = 
                          new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, 
                                  TableRow.LayoutParams.WRAP_CONTENT, 1f);
  
                  int i = 1;
                  for (Iterator&lt;OperazioniClienti&gt; it = listaOperazioni.iterator(); it.hasNext();) {
                      OperazioniClienti op = it.next();
  
                      TableRow row= new TableRow(getActivity());
                      //TableRow.LayoutParams lp = new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT);
                      //row.setLayoutParams(lp);
  
                      row.setLayoutParams(rowParams);
  
                      data.setBackgroundResource(R.drawable.shape_edittext_row);
                      data.setLayoutParams(itemParams);
  
                      TextView codFattura = new TextView(getActivity());
                      codFattura.setText(op.getCodiceFattura().toString());
                      codFattura.setBackgroundResource(R.drawable.shape_edittext_row);
                      codFattura.setLayoutParams(itemParams);
  
  
                      Double saldo = op.getSaldo();
                      TextView importo = new TextView(getActivity());
                      importo.setLayoutParams(itemParams);
                      importo.setBackgroundResource(R.drawable.shape_edittext_row);
                      importo.setGravity(Gravity.RIGHT);
                      importo.setOnClickListener(new OnClickListener() {
                          public void onClick(View v) {
                              //to do
                          }
                      });
  
                      importo.setText("SALDATA"); 
                      importo.setTextColor(Color.BLUE);
  
                      row.addView(codFattura);
                      row.addView(importo);
                      ll.addView(row,i++);
                  }
              }
  </code></pre>
  
  <p>I have use this code to attach the onclick event to all TextView but I don't know how can I get the value:</p>
  
  <pre><code>importo.setOnClickListener(new OnClickListener() {
     public void onClick(View v) {
      //to do
     }
  });
  </code></pre>