title: How can i resize views in runtime
body: <p>In my app, I have two listfragments. if I choose one item in the list then the listfragment is replaced by another fragment. If orientation is landscape I want to show the two fragments side by size(with equal width).</p>
  
  <pre><code>if((new Configuration()).orientation == Configuration.ORIENTATION_PORTRAIT){
      selectItem(savedInstanceState.getInt("fragmentShowing"));
  } else{
          FrameLayout frame = (FrameLayout) findViewById(R.id.content_frame);
          int portraitWidth,portriatHeight;
          portraitWidth = frame.getWidth();
          portriatHeight = frame.getHeight();
          frame.getLayoutParams().width = portriatHeight/2;
          frame.getLayoutParams().height = portraitWidth/2;
          frame.setX(0);
          frame.setY(0);
          frame.requestLayout();
          frame.invalidate();
  
          FrameLayout contentFrame = (FrameLayout) findViewById(R.id.conversation_history);
          contentFrame.getLayoutParams().width = portriatHeight/2;
          contentFrame.getLayoutParams().height = portraitWidth/2;
          frame.setX(portriatHeight/2);
          frame.setY(portraitWidth/2);
          contentFrame.requestLayout();
          contentFrame.invalidate();
  }
  </code></pre>
  
  <p>I have updated the code to reflect on my progress. now it works but they overlap and both take the space of the whole screen
      </p>
  
  <pre><code>    &lt;!-- As the main content view, the view below consumes the entire
           space available using match_parent in both dimensions. --&gt;
      &lt;FrameLayout
          android:id="@+id/content_frame"
          android:layout_width="match_parent"
          android:layout_height="match_parent" /&gt;
      &lt;FrameLayout
          android:id="@+id/conversation_history"
          android:layout_width="0px"
          android:layout_height="0px"/&gt;
  
  
      &lt;!-- android:layout_gravity="start" tells DrawerLayout to treat
           this as a sliding drawer on the left side for left-to-right
           languages and on the right side for right-to-left languages.
           The drawer is given a fixed width in dp and extends the full height of
           the container. A solid background is used for contrast
           with the content view. --&gt;
      &lt;ListView
          android:id="@+id/left_drawer"
          android:layout_width="240dp"
          android:layout_height="match_parent"
          android:layout_gravity="start"
          android:choiceMode="singleChoice"
          android:divider="@android:color/transparent"
          android:dividerHeight="0dp"
          android:background="#111"/&gt;
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>