Wednesday, 15 June 2011

how to do popup window pass value back to the background window in android -



how to do popup window pass value back to the background window in android -

i want utilize popupwindow in app.

click button1 can triggle window popup,

click btnback in popwindow close .

but failed in program.

also want send value in edittext in popwindow backgroung window

how can it? tks!

protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); final layoutinflater inflater = (layoutinflater) this.getsystemservice(context.layout_inflater_service); final popupwindow pw = new popupwindow( inflater.inflate(r.layout.activity_setting, null, false), 200, 200, true); setcontentview(r.layout.activity_memo); button bt1 = (button) findviewbyid(r.id.button1); button bt2 = (button) findviewbyid(r.id.btnback); bt1.setonclicklistener(new button.onclicklistener() { @override public void onclick(view v) { view layout = inflater.inflate(r.layout.activity_memo, listview); showatlocation(layout, gravity.center, 0, 0); } }); bt1.setonclicklistener(new button.onclicklistener() { @override public void onclick(view v) { pw.dismiss(); } }); }

you can have background activity listener of popup window. when button clicked in popup window, phone call method onbuttonclick(string text) on listener. since activity listener, text.

android return-value popupwindow

No comments:

Post a Comment