title: Find position of check box in list view
body: <p>I have a custom adapter for a list view. The row view is a check box. I have used <code>setOnClickListener()</code> to handle when the user clicks the check box. What I am wondering is if there is a way for me to know the position of the check box in the list view when it is clicked. </p>
  
  <p>Here is the code for my adapter if it helps.</p>
  
  <pre><code>private class TagAdapter extends BaseAdapter 
  {
      public TagAdapter(ArrayList&lt;Tag&gt; items) 
      {
          mTagList = items;
      }
      public int getCount() 
      {
          return mTagList.size();
      }
      public Object getItem(int position) 
      {
          return mTagList.get(position);
      }
      public long getItemId(int position) 
      {
          return position;
      }
  
      public View getView(int position, View convertView, ViewGroup parent)
      {
          View V = convertView;
  
          if(V == null) 
          {
              LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              V = vi.inflate(R.layout.tag, null);
          }
  
          Tag t = (Tag) mTagList.get(position);
          TextView tagName = (TextView)V.findViewById(R.id.checkBox1);
          CheckBox cb = (CheckBox)V.findViewById(R.id.checkBox1);
          cb.setChecked(t.isSelected());
          cb.setOnClickListener(new View.OnClickListener() //the add tag button "+"
          {
              public void onClick(View view) 
              {
  
              }
  
         });
  
          tagName.setText(t.getTagName());
          return V;
      }
  
  
  
  }
  </code></pre>