title: Get position of dynamic Image View
body: <p><strong>Outline</strong></p>
  
  <p>My application has a main Image View and below main view, it has dynamic horizontal imageview .</p>
  
  <p><strong>Code for dynamic image view</strong></p>
  
  <pre><code>ImageView imageall = new ImageView(FullImage.this);
  LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(175, 175);
  params.setMargins(10, 0, 0, 0);
  imageall.setLayoutParams(params);
  imageall.setBackgroundResource(R.drawable.imageview_border);
  Picasso.with(context_tab1).load("http://example.com//upload/image/" + stringList.get(in)).into(imageall);
  // Adds the view to the layout
  layout.addView(imageall);
  imageall.setOnClickListener(new View.OnClickListener() {
                          @Override
                          public void onClick(View v) {
                              int position  = (Integer) v.getTag();
                              image = "http://example.com/x/upload/image/" + stringList.get(position);
                              Picasso.with(context_tab1).load(image).into(fullimage);
  
                          }
                      });
                  }
  </code></pre>
  
  <p>I populate the dynamic imageview from array list. Everything works fine till this part.</p>
  
  <p><strong>Problem</strong></p>
  
  <p>Now, On Click of the dynmic imageview must get that image view position and change as the main imageview .</p>
  
  <p>This is not working for me.</p>
  
  <p>For better understanding please find the image attached.</p>
  
  <p><a href="https://i.stack.imgur.com/zdUG3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zdUG3.png" alt="enter image description here"></a></p>
  
  <p>Thanks.</p>