title: RelativeLayout does not adhere to set width when inflated
body: <p>I have a relativeLayout that I would like to use the theme.dialog android theme, it should have a set width of 240dip. When I specify the whole layout and it's children in xml, this works. However, when I try to inflate the xml to add more views (code below), the Layout fills the width of the screen. </p>
  
  <pre><code>Context context = this;
      LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  
      RelativeLayout header = (RelativeLayout) inflater.inflate(R.layout.headphonepopupheader, null);
  </code></pre>
  
  <p>headphonepopup.xml:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="240dp"
  android:layout_height="wrap_content" &gt;
  
  &lt;ImageButton
      android:id="@+id/closebutton"
      android:layout_width="24dp"
      android:layout_height="24dp"
      android:layout_alignParentTop="true"
      android:layout_alignParentRight="true"
      android:layout_marginLeft="216dp"
      android:background="@drawable/closebutton" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Is there a way to solve this?    </p>