title: How to set maximum height for activity (Dialog themed)
body: <p>I'm optimising our Android application for tablets. For much of the application, we're using fragments but for some settings screens, we just want to launch the screen as a dialog for tablets. To achieve this, we set the theme of the Activity in the Manifest </p>
  
  <pre><code>&lt;activity
      android:name="com.company.app.EditTaxTypeSettingsActivity"
      android:theme="@style/ActivityTheme"&gt;
  &lt;/activity&gt;
  </code></pre>
  
  <p>And here's the theme (in res/values-large-v11):</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;resources&gt;         
      &lt;style name="ActivityTheme" parent="@android:style/Theme.Holo.Light.Dialog"&gt;      
      &lt;item name="android:windowIsFloating"&gt;true&lt;/item&gt;
      &lt;/style&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>The activities using this theme open as a dialog and look fine in landscape orientation. But in portrait mode, the dialogs fill the screen vertically which looks silly.</p>
  
  <p>How can I set the maximum height of these dialogs? I have tried settings the maxHeight attribute of the theme <code>&lt;item name="android:maxHeight"&gt;500dip&lt;/item&gt;</code> but it seems to refer to the dialog container around the activity content rather than to activity content itself. (ie, if I set the height of the Activity theme to 500dip, the dialog just gets a very large dialog title area)</p>
  
  <p>I also tried setting the size of the activities layout xml (RelativeLayout) but I can't set a maxHeight, I can only set the height but I can't hard code the height there because I have Save and Cancel buttons set to <code>android:layout_alignParentBottom="true"</code> so they can remain above the keyboard when the keyboard pops up. (Hard coding the activities layout height, prevents the save/cancel buttons from remaining on top of the keyboard)</p>
  
  <p>Thanks, does anyone know how to set a maximum dialog height, preferably at the theme level?</p>