Adding Dialog framework listeners.