title: Android Centered Inner Layout
body: <p>I need a box within a box, with ~33% of empty room at the top of the first box, and then another box below that. I need it to be centered. I would like this to essentially <code>fill_parent</code> on a mobile phone, but on a tablet (the primary device for this app), it should remain the same size but be centered in the middle of the screen. How can I do this?</p>
  
  <p>I'm including to examples since it's a little hard for me to explain.</p>
  
  <p><strong>Mobile</strong></p>
  
  <pre><code>|---------------------------|
  |     ~33% Blank space      |
  |                           |
  |  |---------------------|  |
  |  |                     |  |
  |  |                     |  |
  |  |      Login Box      |  |
  |  |      Password       |  |
  |  |                     |  |
  |  |                     |  |
  |  |                     |  |
  |  |                     |  |
  |  |                     |  |
  |  |---------------------|  |
  |---------------------------| 
  </code></pre>
  
  <p><strong>Tablet</strong></p>
  
  <pre><code>|---------------------------------------|
  |           ~33% Blank space            |
  |                                       |
  |        |---------------------|        |
  |        |                     |        |
  |        |                     |        |
  |        |      Login Box      |        |
  |        |      Password       |        |
  |        |                     |        |
  |        |                     |        |
  |        |                     |        |
  |        |                     |        |
  |        |                     |        |
  |        |---------------------|        |
  |---------------------------------------| 
  </code></pre>
  
  <p><strong>Edit</strong>  Here is the XML I currently have. I'm not getting intellisense for anything, (I usually get suggestions), and I'm getting a cast exception with multiple layouts. Is there something wrong with the XML?</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:weightSum="1"
      &gt;
      &lt;LinearLayout android:id="@+id/topSpacer"
          android:layout_width="fill_parent"
          android:layout_height="0dp"
          android:layout_weight=".33"
          android:orientation="horizontal"
          &gt;&lt;/LinearLayout&gt;
      &lt;LinearLayout
          android:id="@+id/bottomSection"
          android:layout_width="fill_parent"
          android:layout_height="0dp"
          android:layout_weight=".67"
          android:orientation="horizontal"
          &gt;
          &lt;LinearLayout
              android:id="@+id/loginSection"
              android:layout_width="320dip"
              android:layout_height="fill_parent"
              android:background="#FFFFFF"
              &gt;
              &lt;TextView
                  android:text="" 
                  android:id="@+id/errorMessage" 
                  android:layout_height="wrap_content" 
                  android:layout_width="fill_parent" 
              /&gt;
              &lt;TextView 
                  android:text="Please login using your active directory credentials." 
                  android:id="@+id/loginMessage" 
                  android:layout_height="wrap_content" 
                  android:layout_width="fill_parent" 
              /&gt;
              &lt;AutoCompleteTextView 
                  android:id="@+id/loginUsername" 
                  android:text="Username" 
                  android:layout_width="fill_parent" 
                  android:layout_height="wrap_content" 
              /&gt;
              &lt;EditText
                  android:id="@+id/loginPassword"
                  android:text="Password"
                  android:password="true"
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"
              /&gt;
              &lt;Button
                  android:id="@+id/loginButton"
                  android:text="Login"
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"
              /&gt;
              &lt;TextView 
                  android:text="results" 
                  android:id="@+id/resultsMessage" 
                  android:layout_height="wrap_content" 
                  android:layout_width="fill_parent" 
              /&gt;
          &lt;/LinearLayout&gt;
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>