I am trying to make a custom dialog box
LayoutInflater li = LayoutInflater.from(this);
View view = li.inflate(R.layout.rate_layout, null);
RelativeLayout rate = (RelativeLayout) view.findViewById(R.id.rateClick);
RelativeLayout close = (RelativeLayout) view.findViewById(R.id.closeBtn);
close.setClickable(true);
rate.setClickable(true);
final AlertDialog.Builder dd = new AlertDialog.Builder(this);
dd.setView(view);
dd.setCancelable(false);
final AlertDialog d = dd.create();
d.show();
The background image has 4 types of resolutions so I can do wrap content only.
Here is my xml file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<RelativeLayout
android:id="@+id/rateClick"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:background="@drawable/rate_now_button" />
<RelativeLayout
android:id="@+id/imageView1"
android:layout_width="219dp"
android:layout_height="234dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="@drawable/pop_up" >
<RelativeLayout
android:id="@+id/closeBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="@drawable/close_button" >
</RelativeLayout>
<RelativeLayout
android:id="@+id/rateClick"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:background="@drawable/rate_now_button" />
</RelativeLayout>
</RelativeLayout>
This is what I am getting. How am i suppose to remove the dialog layout. The white big borders.

Don’t use AlertDialog.Builder. Try this instead.
or
You can use whatever theme meets your criteria, or create your own. See answer to this question and this other question. See also available themes.
See Dialog for documentation on setContentView(), setCancelable(), show() and other methods you might find useful.