title: Android how to identify item in listview with checkbox
body: <p>I am really stuck here. What I want is not simple (for me), however I've been programming android a year now.
  What I want is a listview with an imageview, a textview, a checkbox, and another textview in each row.
  Let's have a textview and a checkbox first in the layout.
  Based on <a href="http://windrealm.org/tutorials/android/listview-with-checkboxes-without-listactivity.php" rel="nofollow noreferrer">this</a> tutorial I managed to do that (there are a lot, but this seems to be the best for me). I have a listview populated with textviews and checkboxes.</p>
  
  <p>This is the result:</p>
  
  <p><img src="https://i.stack.imgur.com/KFFIT.png" alt="enter image description here"></p>
  
  <p>This is how I get the text of textview I click on:</p>
  
  <pre><code> textView.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              TextView tv = (TextView) v ;
              String text_of_clicked_textview = tv.getText().toString();
              Log.i("TAG", "" + text_of_clicked_textview);
          }
      });
  </code></pre>
  
  <p>So When I click on Mercury, I get <em>Mercury</em> in the text_of_clicked_textview variable.</p>
  
  <p>But how can i check which checkbox I clicked on? E.g I click on the 3rd checkbox, I want to now it is in the row of Earth. Best would be if I get to know both the text of textview in the row of the listview(<em>Earth</em>) and and number of the item (<em>3</em>).</p>
  
  <p>I guess I have to set an onClickListener on the checkbox but what next?</p>
  
  <pre><code>checkBox.setOnClickListener( new View.OnClickListener() {
        public void onClick(View v) {
          CheckBox cb = (CheckBox) v ;
  
        }
      });
  </code></pre>