title: Understanding android dialog layouts
body: <p>I'm making a simple custom dialog for my android app, displaying only a seek bar. However, the complications of this simple task are driving me nuts.</p>
  
  <p>My layout for the dialog is as follows:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:padding="10dp"&gt;
  
  &lt;SeekBar xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/dialogVolumeSlider"
      android:layout_width="225dp"
      android:layout_height="wrap_content"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>The dialog is created in code:</p>
  
  <pre><code>Dialog d = new Dialog(this);
  d.setContentView(R.layout.custom_dialog);
  return d;
  </code></pre>
  
  <p>Instead of a simple box wrapping the seekbar, I get this phantom space coming from somewhere:</p>
  
  <p><img src="https://i.stack.imgur.com/endiU.png" alt="Problem screenshot"></p>
  
  <p>What's the issue here? I've tried modifying</p>
  
  <pre><code>d.getWindow().getAttributes().height
  </code></pre>
  
  <p>but this creates additional problems as well. </p>
  
  <p>Thanks for any help!!</p>
  
  <p>EDIT: Stranger things happen when I assigned a fixed "50dp" to my LinearLayout's layout_height:
  <img src="https://i.stack.imgur.com/BLjcq.png" alt="Second problem"></p>