title: How to generate copies of LinearLayout in java inside loop
body: <p>I want to know how could I copy a particular LinearLayout like this:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;LinearLayout
      android:id=&quot;@+id/someID&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;520dp&quot;
      android:layout_marginBottom=&quot;25dp&quot;
      android:background=&quot;@drawable/corner_rounder&quot;
      android:orientation=&quot;vertical&quot;&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  <p><strong>Inside Java code</strong> using <strong>for</strong> loop. I need such a solution to dynamically generate content depending on its quantity. This LinearLayout is inside ScrollView.</p>