title: Android : get id of listview row when button clicked
body: <p>i have a listview that contains relative views on each list item that are populated by a database and contains two buttons. 
  when one of the buttons in the list view item is pressed i need to get the id of that row in the list view. in other words i am trying to find the same thing as the last argument in the onItemClick methos for the onItemClickListener(), which would return a click for the entire item. however i am just listening for the button in the listview item so i am unable to use onItemClickListener().</p>
  
  <p>i have this method being called when i click the button</p>
  
  <pre><code>public void plusClick(View v) 
      {
  
          //get the row the clicked button is in
          RelativeLayout vwParentRow = (RelativeLayout)v.getParent();
  
          //i need to get the id of this RelativeLayout item in the list view
  
          TextView child = (TextView)vwParentRow.getChildAt(2);
          Button btnChild = (Button)vwParentRow.getChildAt(1);
  
  
          int c = Color.CYAN;
  
  
          vwParentRow.setBackgroundColor(c); 
          vwParentRow.refreshDrawableState();       
      }
  </code></pre>
  
  <p>it need to find the id of the relative layout which i can pass ass arg for</p>
  
  <pre><code>public Cursor getRow(long rowId) {
      String where = KEY_ROWID + "=" + rowId;
      Cursor c =  db.query(true, DATABASE_TABLE, ALL_KEYS, 
                      where, null, null, null, null, null);
      if (c != null) {
          c.moveToFirst();
      }
      return c;
  }
  </code></pre>
  
  <p>to create a new cursor contiain the data in this listview item</p>