u have another option, design a xml layout
for your dialog box how u requird and call it in your activity
example xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="215dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/custom_alert"
android:orientation="vertical" >
<TextView
android:id="@+id/tv_header"
android:layout_width="fill_parent"
android:layout_height="26dp"
android:gravity="center"
android:text="@string/oops"
android:textColor="#3f3f3f"
android:textSize="15sp"
android:textStyle="bold"
/>
<TextView
android:id="@+id/tv_description"
android:layout_width="fill_parent"
android:layout_height="58dp"
android:layout_below="@+id/tv_header"
android:gravity="center"
android:textColor="#747474"
android:textSize="10sp"
android:typeface="sans" />
<View
android:id="@+id/separator"
android:layout_width="fill_parent"
android:layout_height="1dip"
android:layout_above="@+id/tv_actionbtn"
android:layout_centerVertical="true"
android:background="#b8b8b8" />
<TextView
android:id="@+id/tv_actionbtn"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_below="@+id/tv_description"
android:gravity="center"
android:textColor="#d61820"
android:textSize="15sp"
android:typeface="sans" />
custom_alert background layout:
<corners android:color="#FFFFFF" />
<solid android:color="#FFFFFF" />
<stroke
android:width="3dip"
android:color="#FFFFFF" />
<corners
android:radius="20dip"
android:color="#FFFFFF" />
<padding
android:bottom="0dip"
android:left="0dip"
android:right="0dip"
android:top="0dip" />
here is the activity code
dialog = new Dialog(Activity.this);
dialog.setContentView(R.layout.customdialog);
dialog.getWindow().setBackgroundDrawable(
new ColorDrawable(android.graphics.Color.TRANSPARENT));
txtHeader = (TextView) dialog.findViewById(R.id.requiredheader);
txtDiscription = (TextView) dialog.findViewById(R.id.requireddescription;
txtHeader.setText(getResources().getString(R.string.conneting_server));
txtDiscription.setText(getResources().getString(R.string.logging_in));
dialog.setCancelable(false);
dialog.show();
Due Alert
")); this code work thnx my self – user3472001 Apr 11 '14 at 07:26