title: How to create relativelayouts with java code?
body: <p>I need to learn creating relativelayouts with java code instead of XML code.</p>
  
  <p>for example, will be nice to understand how to build this XML with java code:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent" &gt;
   &lt;Button
          android:id="@+id/btnButton1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Button 1"/&gt;
  &lt;Button
          android:id="@+id/btnButton2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Button 2"
          android:layout_toRightOf="@+id/btnButton1"/&gt; 
       &lt;Button
          android:id="@+id/btnButton3"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Button 3"
          android:layout_below="@+id/btnButton1"/&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>I can't find any examples of doing this with java code</p>
  
  <p>Please, can someone help me to transform that layout into java code? or can someone give me tutorial links to do relativelayouts with java code?</p>
  
  <p>thanks</p>