Reputation: 857
I need to be notified when there are changes on the screen. Currently I am using
this.getWindow().getDecorView().getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener()
{
@Override
public void onGlobalLayout()
{
Log.d("TAG", "GLOBAL LAYOUT");
}
});
But it doesn't work when dialog(custom, alert, progress, etc.) is shown or dismissed. I understand that dialogs are shown on another overlay so listener isn't attached to them. How can I get my desired functionality?
Upvotes: 0
Views: 252
Reputation: 5186
You probably need a dialog.setOnDismissListener or dialog.setOnCancelListener
They'll be called when something related to dialog dismissal happens or is being canceled.
Upvotes: 2