title: How to Set onClicklistener Method of ImageView in Android?
body: <p>I am Adding an array of <code>ImageView</code>s  and set an image to each <code>ImageView</code> dynamically and I'm done with it. But the problem is how to set/define onClicklistener Method on an <code>ImageView</code>?</p>
  
  <p>Here is my Code:</p>
  
  <pre><code>ImageView[] mImages;
  int[] images={R.drawable.sandle_icon1, R.drawable.sandle_icon2,
              R.drawable.sandle_icon3, R.drawable.sandle_icon4};
  
  LinearLayout ll = new LinearLayout(this);
  mScrollViewImage.removeAllViews();
  ll.setOrientation(LinearLayout.VERTICAL);
  mImages = new ImageView[images.length];
  mScrollViewImage.addView(ll);
  for (floop = 0; floop &lt; sandleicon.length; floop++) {
      mImages[floop] = new ImageView(this);
      mImages[floop].setImageResource(images[floop]);
          ll.addView(mImages[floop]);
  }
  </code></pre>
  
  <p>Any helps will be greatly appreciated.</p>