title: Get item selected in the custom adapter listview android
body: <p>My every list view item has its own linearlayout component.The list view is in the activity with onItemClick on itself.</p>
  
  <p>In my custom adapter file, I have the onclick on this linearlayout,</p>
  
  <pre><code>private ArrayList&lt;Book&gt; bookArray; // this is the data source
   .........
  
  LinearLayout imgLayout = (LinearLayout) rowView.findViewById(R.id.imageLayout);
  imgLayout.setOnClickListener(new OnClickListener() {
      @Override
      public void onClick(View v) { // fire user Like
          //*** how can I get which item is selected here?
  </code></pre>
  
  <p>But how can I get the item index whose linearlayout is clicked?</p>
  
  <p>Regards
  Hammer</p>