title: dynamically set LinearLayout height/width in relativelayout
body: <p>i have a linearLayout inside a RelativeLayout. I need to be able to set the height of the linearlayout dynamically depending on the screen dimensions. Im having some difficulties. 
  how can i achieve this?</p>
  
  <p>MAIN :</p>
  
  <pre><code> public class MainActivity extends Activity {
  
  LinearLayout L;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      L=(LinearLayout)findViewById(R.id.top);
  
      L.setLayoutParams(new LinearLayout.LayoutParams(1080, 400));
  }
  
  }
  </code></pre>
  
  <p>XML:</p>
  
  <pre><code> &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:tools="http://schemas.android.com/tools"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
  
   tools:context=".MainActivity" &gt;
  
   &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="#fff"
      android:id="@+id/top"
      android:orientation="horizontal" &gt;
  
      &lt;TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/hello_world" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>