title: android: How to get the ID of a textview when clicked?
body: <p>I have an activity that queries from sqllite and display the output to xml</p>
  
  <p>this is part of the activity</p>
  
  <pre><code>( (TextView) view.findViewById(R.id.tv_id) ).setText( listItem.getId()+"");
  ( (TextView) view.findViewById(R.id.tv_name) ).setText( listItem.getName() );
  ( (TextView) view.findViewById(R.id.tv_age) ).setText( listItem.getAge()+"" );
  </code></pre>
  
  <p>and this is the xml:</p>
  
  <pre><code>&lt;TableLayout 
    android:layout_width="wrap_content" 
    android:id="@+id/TableLayout01" 
    android:layout_below="@+id/tv_age" 
    android:layout_height="wrap_content" 
    android:layout_toRightOf="@+id/tv_name"&gt;
    &lt;TableRow 
     android:layout_width="wrap_content" 
     android:layout_below="@+id/tv_age" 
     android:layout_height="wrap_content" 
     android:layout_toRightOf="@+id/TableLayout01"   
     android:id="@+id/TableRow01"&gt;
     &lt;TextView 
      android:layout_width="10dip" 
      android:layout_height="30dip"     
      android:id="@+id/tv_id" 
      android:text=""     
      android:layout_centerVertical="true"&gt;
     &lt;/TextView&gt;
     &lt;TextView 
      android:layout_width="100dip" 
      android:layout_height="wrap_content" 
      android:text="" android:id="@+id/tv_name" 
      android:layout_centerVertical="true" 
      android:layout_toRightOf="@+id/tv_id" 
      android:layout_marginLeft="10px"&gt;
     &lt;/TextView&gt;
     &lt;TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="" android:id="@+id/tv_age" 
      android:layout_centerVertical="true" 
      android:layout_toRightOf="@+id/tv_name" 
      android:layout_marginLeft="10px"&gt;
     &lt;/TextView&gt;
    &lt;/TableRow&gt;
   &lt;/TableLayout&gt;
  </code></pre>
  
  <p>Now this works fine.  It displays the resulting query.  Now, I want to create another activity which responds to the long press or just one touch when the query is displayed.  How can I get the ID of the pressed textview so I can use it for the other activity?</p>
  
  <p>many thanks for your help.</p>