android - Attaching listener to dialog -
i need notified when there changes on screen. using
this.getwindow().getdecorview().getviewtreeobserver().addongloballayoutlistener(new viewtreeobserver.ongloballayoutlistener() { @override public void ongloballayout() { log.d("tag", "global layout"); } });
but doesn't work when dialog(custom, alert, progress, etc.) shown or dismissed. understand dialogs shown on overlay listener isn't attached them. how can desired functionality?
you need dialog.setondismisslistener or dialog.setoncancellistener
they'll called when related dialog dismissal happens or being canceled.
Comments
Post a Comment