Changing relative layout programmatically
<p>I've relative layout i.e. <strong>main.xml</strong> which I set as follows. But now I've to put view1 on view2 with <strong>width=200dp and height =100dp</strong>, so that view2 will be large one and  view1 will be small one on it.</p>

<pre><code>public void onCreate(Bundle savedInstanceState) 
         {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
         }
</code></pre>

<p><strong>main.xml</strong></p>

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

    &lt;RelativeLayout
    android:id="@+id/MainPanel"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_above="@id/panel_bottom"
    android:layout_gravity="center_horizontal" &gt;

    &lt;com.proj.demo.view1
        android:id="@+id/sheet"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignWithParentIfMissing="true"
        android:layout_centerInParent="true"
        android:layout_toLeftOf="@+id/panel_quick_buttons"
        /&gt;

    &lt;com.proj.demo.view2
        android:id="@+id/sheet2"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignWithParentIfMissing="true"
        android:layout_centerInParent="true"
        android:layout_toLeftOf="@+id/panel_quick_buttons"
      /&gt;

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