I have an activity class. For this Activity class, I have an XML layout. I want to display this activity class as a dialog, So to do so in the manifest I do the following change.
<activity
android:name=".AlarmDialogActivity"
android:theme="@android:style/Theme.Dialog">
</activity>
When I run my app the activity class display as dialog, But the width of the is compressed, it does not take the full screen of the device. Why does this happen? Can anyone help me to solve this out?
Code for xml layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_alarm_dialog"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#E0D5B1"
android:gravity="center_vertical|center_horizontal"
android:orientation="vertical" >
<TextView
android:id="@+id/dialog_title_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/dialog_title_text"
android:textColor="#e89192"
android:textSize="18dp" >
</TextView>
<ListView
android:id="@+id/alarm_list_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:layout_marginTop="10dp"
android:cacheColorHint="#00000000"
android:divider="@null"
android:dividerHeight="0dp"
android:listSelector="#00000000" >
</ListView>
<LinearLayout
android:id="@+id/bottom_control_bar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center_horizontal|center_vertical" >
<Button
android:id="@+id/button_dismiss"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_dismiss_text"
android:textColor="#121212"
android:textSize="18dp" >
</Button>
</LinearLayout>
</LinearLayout>
Screenshot of the dialog

try this: