popup - Android close multiple pop-up windows -


i know how close popup button, need do, make method close popups, haven't been closed yet when need to. have method popup() use generating popups. call random number of times.

after user can close of them, when button on main screen pressed, want call own method closeallpopups(), , should dismiss of ones have not been dismissed yet.

any idea how implement method? thankful.

r.layout.popup: simple relative layout, not important.

private void popup(){                 layoutinflater layoutinflater = (layoutinflater)getbasecontext()                        .getsystemservice(layout_inflater_service);                view view = layoutinflater.inflate(r.layout.popup, null);                 final popupwindow popupwindow = new popupwindow(view,200,300);                 popupwindow.showatlocation(view, 0, 200, 300); //popupi x ja y pos                 button btndismiss = (button)view.findviewbyid(r.id.dismiss);                  btndismiss.setonclicklistener(new button.onclicklistener(){                    @override                    public void onclick(view v) {                         popupwindow.dismiss();                       }});            } 

you can try storing dialogs in arraylist , dismiss them iterating on them .


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -