android 获取对话框关闭事件

android中如果想要监听对话框是否已经关闭可以使用

DialogInterface.OnDismissListener

就可以监听到当对话框关闭的事件。


1. void onDismiss(DialogInterface dialog) 
          This method will be invoked when the dialog is dismissed.


 

void onDismiss(DialogInterface dialog)
This method will be invoked when the dialog is dismissed.

参数:
dialog - The dialog that was dismissed will be passed into themethod.

2.实例

dialog.setOnDismissListener(new OnDismissListener() {
            
            @Override
            public void onDismiss(DialogInterface dialog) {
                 //处理监听事件
            }
        });


转自:http://www.apihome.cn/api/android/DialogInterface.OnDismissListener.html

你可能感兴趣的:(android,UI,android,知识点)