Background for popup is not displayed in Android -


i new android developer trying write simple contact book. when select delete button has ask confirmation in popup. there no background popup. in code wrote popup in listener in same parent activity.

enter image description here

    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 xml file goes 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 text view , 2 buttons can guide me what's problem ?

background in popup transparent default. must set background popup.

<?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:background="#000000"      android:orientation="vertical" > 

Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -