In an Android application, 

On a pop up window, when the screen rotates, the pop up window disappears 

I've put a dismiss listener there and when the return button is clicked, the listener is invoked  

It is working fine 

```
   popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {

            @Override
            public void onDismiss() {

                // it is working fine when the pop up is dismissed by the return click

            }
        }); 

```

The point is when the screen rotates, this listener is not invoked even though the pop up window is disappeared, Why?