android - PopUpWindow dismiss issue -


i have show popupwindow. if show in click event of imageview, call dismiss hides. when show in touch event of imageview, dismiss event calls, popup not hides. reasons error?. how can solve it?

the code used show popup window is

displaymetrics dm = new displaymetrics();     getwindowmanager().getdefaultdisplay().getmetrics(dm);     int width = dm.widthpixels; //320            cabotmessagehandler.printconsole("width of screen"+width);      //show popup     layoutinflater inflater = (layoutinflater)        this.getsystemservice(context.layout_inflater_service);     popupview=inflater.inflate(r.layout.gallerytoppopup, null, false);     pw = new popupwindow(        popupview,         width,         30,         true);     // code below assumes root container has id called 'main'     pw.setanimationstyle(r.anim.popupanimation);     pw.showatlocation(this.findviewbyid(r.id.webview), gravity.top, 0, 30); 

finally find out problem. touch event calls twice, , 2 popups created. reason not hide popup when dismiss called.(one popup hides , other remains there).


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -