Q:

Custom AlertDialog size being ignored

I have a custom alertdialog thats 250dp by 300dp, but when its rendered, the dimensions basically become match_parent. From my understanding, this may be caused by passing null to LayoutInflater.inflate(), but I am producing this custom dialog from a fragment(in onPostExecute() of an asynctask specifically), not an adapter, so I'm not really sure how to obtain a reference to the parent viewgroup.
layout.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="300dp" android:layout_height="250dp"
    android:background="@drawable/ad_dialog_background">

<Button
    android:layout_width="200dp"
    android:layout_height="30dp"
    android:text="dismiss"
    android:id="@+id/dismissButton_ad"
    android:background="@drawable/border"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    android:layout_marginBottom="10dp"
    android:textColor="#484848" />

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/dialogTitle_ad"
    android:textSize="20dp"
    android:textColor="#000000"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="16dp"
    android:text="Quote Request Successful" />

<TextView
    android:layout_width="180dp"
    android:layout_height="148dp"
    android:text="Company XYZ:\n\nhas a special on X items from thus and thus a date to thus and thus a date"
    android:id="@+id/text_ad"
    android:textColor="#000000"
    android:layout_below="@+id/dialogTitle_ad"
    android:layout_toLeftOf="@+id/actionButtonOne_ad"
    android:layout_toStartOf="@+id/actionButtonOne_ad"
    android:layout_marginTop="10dp" />

<Button
    android:layout_width="90dp"
    android:layout_height="30dp"
    android:id="@+id/actionButtonOne_ad"
    android:background="@drawable/round_corners_list"
    android:textColor="#f7f7f7"
    android:layout_above="@+id/actionButtonTwo_ad"
    android:layout_alignLeft="@+id/actionButtonTwo_ad"
    android:layout_alignStart="@+id/actionButtonTwo_ad"
    android:layout_marginBottom="10dp"
    android:layout_marginRight="3dp"
    android:textSize="11dp"
    android:text="dssd" />

<Button
    android:layout_width="90dp"
    android:layout_height="30dp"
    android:id="@+id/actionButtonTwo_ad"
    android:background="@drawable/round_corners_list"
    android:textColor="#f7f7f7"
    android:layout_centerVertical="true"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true"
    android:layout_marginRight="3dp"
    android:textSize="11dp" />

<Button
    android:layout_width="90dp"
    android:layout_height="30dp"
    android:id="@+id/actionButtonThree_ad"
    android:background="@drawable/round_corners_list"
    android:textColor="#f7f7f7"
    android:layout_below="@+id/actionButtonTwo_ad"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true"
    android:layout_marginTop="10dp"
    android:layout_marginRight="3dp"
    android:textSize="11dp" />

fragment.java:
LayoutInflater inflater = LayoutInflater.from(getActivity());
View view = inflater.inflate(R.layout.ad_dialog, null);
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setView(view);
final AlertDialog dialog = builder.create();
//findViewsById()...
dialog.show();

A:

My error was using an AlertDialog instead of a Dialog and calling setContentView(R.layout.myview) on the Dialog object.

