title: Set the width of relativelayout 1/3 the width of the screen?
body: <p>I have a layout like below. Now, I don't want to set the width of relative layout to fixed 240 dp. I want to set the width of the relative layout to 1/3 the width of the screen. Is it possible to do that in the xml file. If it is impossible, how can I achieve that using java code ? </p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:id="@+id/fullscreen"
          style="@style/translucent"&gt;
             &lt;RelativeLayout
              android:layout_width="240dp"
              android:layout_height="fill_parent"
              android:layout_gravity="right"
              android:gravity="center"
              android:background="#88000000"
              android:id="@+id/sidebar"&gt;
  
             &lt;/RelativeLayout&gt;
  
      &lt;/FrameLayout&gt;
  </code></pre>