title: AlertDialog is wider than it should expected
body: <p>Today problem is that on Android 2.3.5 showing custom dialog is wrong. Dialog width is wider than it should be. </p>
  
  <p><img src="https://i.stack.imgur.com/SVc0P.png" alt="enter image description here"></p>
  
  <p>I tried using <code>20dp</code> instead of <code>wrap_content</code> in <code>TextView</code> as in <code>LinearLayout</code> with no success. I would like get rectangle shape with <code>wrap_content</code> as it is in <code>Android 4</code>.</p>
  
  <p>Here is xml code for this custom dialog's view.</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="wrap_content"
      android:layout_height="wrap_content"
      android:gravity="center"
      android:orientation="vertical" &gt;
  
      &lt;TextView
          android:id="@+id/text"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:gravity="center"
          android:text="Please wait" &gt;
      &lt;/TextView&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Here is a a custom dialog's code, anything else is not important.</p>
  
  <pre><code>AlertDialog.Builder builder = new AlertDialog.Builder(context);
          AlertDialog dialog;
  
          LayoutInflater inflater = (LayoutInflater) context.getSystemService(Service.LAYOUT_INFLATER_SERVICE);
          View layout = inflater.inflate(R.layout.dialog_progressdialog,
                                         null);
  
          builder.setView(layout);
  
          //initializing textview
  
          dialog = builder.create();
  
          //do other stuff
  </code></pre>
  
  <p>On android 4.0.3 I get rectangle, so it looks ok - it is as I wanted. What might be the problem, does anyone find this kind of problem? Sorry, I don't have sample for <code>Android 4</code> - no phone today to make sample.</p>
  
  <hr>
  
  <p>If I put inside also <code>progressbar</code> I am able to create square in android 4, but it is impossible to do it in Android 2.3.</p>
  
  <p>Android 2.3.5</p>
  
  <p><img src="https://i.stack.imgur.com/74xbi.png" alt="enter image description here"></p>
  
  <p>Android 4.0.4</p>
  
  <p><img src="https://i.stack.imgur.com/8TEAd.png" alt="enter image description here"></p>