When I use in layout, which specifies this dialog android:layout_width=\"match_parent\" I get this dialog:
android:layout_width=\"match_parent\"
Another way to fix this is to use:
import android.support.v7.app.AlertDialog;
instead of:
import android.app.AlertDialog;