How to add Relative layout in Relative layout dynamically
<p>My project file has <code>XML</code> like root <code>xml</code>. In root <code>xml</code> i define a <code>Relative layout</code> like below</p>

<pre><code>    &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/root_view"&gt;
    &lt;/RelativeLayout&gt;
</code></pre>

<p>I have another <code>xml</code> file first is <code>one.xml</code> and another is <code>two.xml</code> like below</p>

<p><strong>one.xml</strong></p>

<pre><code>     &lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:visibility="gone"
        android:id="@+id/two_video_layout"&gt;

             &lt;TextView
                    android:id="@+id/two_video_title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dp"
                    android:singleLine="true"
                    android:text="Video Title" /&gt;


&lt;/RelativeLayout&gt;
</code></pre>

<p>and another layout is </p>

<p><strong>two.xml</strong></p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
        &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:visibility="gone"
            android:id="@+id/two_video_layout"&gt;

                 &lt;Imageview
                        android:id="@+id/image"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                         /&gt;


    &lt;/RelativeLayout&gt;
</code></pre>

<p>How can we add <code>one.xml</code> or <code>two.xml</code> dynamically in <code>root.xml</code> with certain condition and how can access reference of textview of <code>one.xml</code> file</p>