Code example for DialogFragment

Methods: dismiss, getTargetFragment, isResumed

		// We'll get around this by setting mTask to null in that case - onResume will then call dismiss() 
		// Setting mTask to null also ensures that we don't declare the task cancelled on dismiss 
		mTask = null;
		if (isResumed()) {
		// Tell the fragment that we are done. 
		Fragment target = getTargetFragment();
		if (target != null) {
			if (!(target instanceof Callbacks)) {
				throw new IllegalStateException("DetectorTaskFragment target must implement its callbacks");