title: ListView. Getting itemId when click on imageView
body: <p>In my ListView each item consists of ImageView and TextView.
  I want when I click on image - get itemid(and then show image in dialog).</p>
  
  <p>How to catch click on ImageView and get Id of ListItem?</p>
  
  <p><img src="https://i.stack.imgur.com/y7s4T.jpg" alt="enter image description here"></p>
  
  <pre><code>ImageView image;
  
      @Override
          public void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.content_friends);
  
              contactsList=(ListView)findViewById(android.R.id.list);
              contactsList.setOnItemClickListener(clickListener);
  
              image = (ImageView)findViewById(R.id.image_a);
              image.setOnClickListener(imListener);
  
          }
  
          OnItemClickListener clickListener = new OnItemClickListener() {
              @Override
              public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long itemId) {            
              Toast.makeText(getApplicationContext(), "listItem " + itemId, Toast.LENGTH_SHORT).show();
  
              }
          };
  
          OnClickListener imListener = new OnClickListener() {
  
              @Override
              public void onClick(View v) {
                     Toast.makeText(getApplicationContext(), "Image of listItem ", Toast.LENGTH_SHORT).show();
  
              }
          };
  </code></pre>