title: List item width does not match parent inside dialog
body: <p>I'm trying to make a simple listView with string objects only inside dialog; the problem is the list item is not width <code>match_parent</code> as i set:</p>
  
  <p><a href="https://i.stack.imgur.com/l6O7Y.png" rel="noreferrer"><img src="https://i.stack.imgur.com/l6O7Y.png" alt="enter image description here"></a></p>
  
  <p>the list view is the root element:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;ListView xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:background="#ff0000"
      android:id="@+id/lvLinks"
      android:layout_height="match_parent"/ &gt;
  </code></pre>
  
  <p>list item:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;TextView xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:padding="7dp"
      android:textSize="15sp"
      android:background="#0000ff"
      android:layout_height="match_parent" /&gt;
  </code></pre>
  
  <p>adapter: </p>
  
  <pre><code>ListView lv = (ListView) findViewById(R.id.lvLinks);
  ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(context,R.layout.list_item_links,items);
  lv.setAdapter(adapter);
  </code></pre>
  
  <p>I've tested it on many OS, this is not the problem</p>
  
  <p><strong>FIXED</strong>:
  <a href="https://stackoverflow.com/a/31610145/3166417">answer</a></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent" &gt;
      &lt;ListView xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="match_parent"
          android:background="#ff0000"
          android:id="@+id/lvLinks"
          android:layout_height="match_parent" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>