I am a new android developer trying to write a simple contact book. When I select delete button it has to ask for a confirmation in a popup. But there is no background for popup. In my code I wrote the popup in a listener in the same parent activity.

protected void delPopup() {
// TODO Auto-generated method stub
LayoutInflater inflater = (LayoutInflater) DisplayContact.this
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.sure,(ViewGroup) findViewById(R.id.popup_element));
yes_btn = (Button) layout.findViewById(R.id.buttonYes);
no_btn = (Button) layout.findViewById(R.id.buttonNo);
pw = new PopupWindow(layout, 300, 470, true);
pw.showAtLocation(layout, Gravity.CENTER, 0, 0);
prepareListeners();
buttonClick();
mOpenHelper = new DatabaseHelper(this);
};
and the xml file goes like this
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/popup_element"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
and A text view , 2 buttons
Can someone guide me what’s the problem ?
Background in popup is transparent by default. You must set background for your popup.