Q:

Why is my alert dialog not showing all its contents

I am trying to customize my alert dialog with a layout. The problem is that the ALert dialog box is lunched with small size and most of the layout is trancated or words are overlapping. It is not screen issue as the dialog box is very small and does not seem to expand to cover all the contents. Why do you think this is happening?
I am using the following layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <LinearLayout
        android:id="@+id/linearLayout2"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_above="@+id/linearLayout1"
        android:layout_alignParentLeft="true"
        android:orientation="horizontal" >

        <TextView
            android:id="@+id/tvNa"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"/>

        <EditText
            android:id="@+id/etNa"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/linearLayout1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true"
        android:orientation="horizontal" >

        <TextView
            android:id="@+id/tvQ"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"/>

        <EditText
            android:id="@+id/etQ"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1" />

    </LinearLayout>

    <LinearLayout
        android:id="@+id/linearLayout3"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/linearLayout1"
        android:layout_centerVertical="true"
        android:orientation="horizontal" >

        <TextView
            android:id="@+id/tvP"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="0.5" />

        <EditText
            android:id="@+id/etP"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:inputType="numberDecimal" />

    </LinearLayout>

</RelativeLayout>

And I am using the following code:
AlertDialog.Builder alert = new AlertDialog.Builder(this);
LayoutInflater inflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

View layout = inflater.inflate(R.layout.add_dialog, null);
alert.setView(layout);
alert.setTitle("New one");
alert.setPositiveButton("Ok",new DialogInterface.OnClickListener() {
@Override
    public void onClick(DialogInterface dialog, int whichButton) {

    }
});
alert.setNegativeButton("Cancel",new DialogInterface.OnClickListener() {
@Override
    public void onClick(DialogInterface dialog, int whichButton) {

    }
});
alert.show();

A:

The Dialog Object has a set max size that you have not over written. You could add your layout to a ScrollView.  Other than that you will have to follow the inheritances of the Dialog until you find where the max Dialog size is being set and override this.  GrepCode is a good place to view the SDK source.

