If the dialog is dismissed,I want to do something for my background.So I want to know if the dialog is dismissed
You can use an onDismissListener
http://developer.android.com/reference/android/content/DialogInterface.OnDismissListener.html
public Dialog createDialog() {
Dialog d = new Dialog(this);
d.setOnDismissListener(new OnDismissListener() {
@Override
public void onDismiss(final DialogInterface arg0) {
// do something
}
});
return d;
}
If you are using a DialogFragment
just override onDismiss()