android - return a value from an activity that is called by a popup window -
i want call activity popup window, using method startactivity(), next want pass value activity field in popup window
i trying pass value using startactivityforresult(), cannot override onactivityresult()
how can this, there other way ?
so whats issue? want know how write class pop window? below code might help. edit way want , write intent
next activity. can data getintent
, send data putextra
throughout activities in android. public class showpopup extends activity {
popupwindow popup; linearlayout layout; textview tv; layoutparams params; linearlayout mainlayout; button but; boolean click = true; public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); popup = new popupwindow(this); layout = new linearlayout(this); mainlayout = new linearlayout(this); tv = new textview(this); = new button(this); but.settext("click me"); but.setonclicklistener(new onclicklistener() { public void onclick(view v) { if (click) { popup.showatlocation(mainlayout, gravity.bottom, 10, 10); popup.update(50, 50, 300, 80); click = false; } else { popup.dismiss(); click = true; } } }); params = new layoutparams(layoutparams.wrap_content, layoutparams.wrap_content); layout.setorientation(linearlayout.vertical); tv.settext("hi sample text popup window"); layout.addview(tv, params); popup.setcontentview(layout); // popup.showatlocation(layout, gravity.bottom, 10, 10); mainlayout.addview(but, params); setcontentview(mainlayout); }
}
Comments
Post a Comment