title: Android - How do I specify weight programmatically for a RelativeLayout?
body: <p>I want to do something like this programmatically -</p>
  
  <pre><code>&lt;LinearLayout&gt;
    &lt;RelativeLayout1 weight = 1&gt;
    &lt;RelativeLayout2 weight = 3&gt;
    &lt;RelativeLayout3 weight = 1&gt;
  &lt;LinearLayout&gt;
  </code></pre>
  
  <p>It does not let me do a setWeight programmatically. However, I do see that RelativeLayout has an android:layout_weight parameter in XML. Am I missing something?</p>