android 获取对话框关闭事件
16lz
2021-12-04
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(安卓)LinearLayout 嵌套 button 监听LinearLayout的onCl
- android-listview控件
- Android(安卓)自定义格式的对话框
- Android(安卓)Compatibility zoom dialog 关闭
- Android(安卓)Compatibility zoom dialog 关闭
- Android(安卓)仿IOS搜索框
- 【Android】Android中AlertDialog对话框的使用实例
- 旋转对话框
- Android(安卓)第三方应用监听home键