title: How to inflate multiple instances of a layout with the same id inside an inflated layout
body: <p>I have a LinearLayout with many nested LinearLayouts and TextViewss</p>
  
  <p>My main activity inflates the main LinearLayout,</p>
  
  <p>Then I load data from a server and based on the data received, I add multiple Layouts in a place holder (LinearLayout)</p>
  
  <p>This is simple a news page where I load Images associated with the news and place it inside an initially empty LinearLayout.</p>
  
  <p>Each Image has the following info: Title(TextView), Date(TextView), Image(ImageView) so what I actually do is the following:</p>
  
  <p>*<strong>Please notice that this is only the essential coded in the question I elemenated all the try -> catch ... if/else ....etc</strong></p>
  
  <pre><code>public void addImages(JSONArray images){
        ViewGroup vg = (ViewGroup) findViewById(R.id.imagesPlaceHolder);
  
  
        // loop on images
        for(int i =0;i&lt;images.length;i++){
  
            View v = getLayoutInflater().inflate(R.layout.image_preview,vg);
            // then 
            I think that here is the problem 
            ImageView imv = (ImageView) v.findViewById(R.id.imagePreview);
            TextView dt = (TextView) v.findViewById(R.id.dateHolder);
            TextView ttl = (TextView) v.findViewById(R.id.title);
            // then 
            dt.setText("blablabla");
            ttl.setText("another blablabla");
            // I think the problem is here too, since it's referring to a single image
            imv.setTag( images.getJSONObject(i).getString("image_path").toString() );
            // then Image Loader From Server or Cache to the Image View
  
        }
  }
  </code></pre>
  
  <p>The code above works good for a single image</p>
  
  <p>But for multiple images the Image Loader doesn't work I guess it's because all ImageViews (Inflated multiple times) have the same ID</p>