How to know if a dialog is dismissed in Android?

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

If you are using a DialogFragment just override onDismiss()

http://developer.android.com/reference/android/app/DialogFragment.html#onDismiss(android.content.DialogInterface)