Create Interface (i.e. MyDialogCallbackContract) with the method to be used to pass the data you need back to invoking Fragment (i.e. methodToPassDataBackToFragment(... data);).

Ensure your DialogFragment (or "ordinary" Fragment, as the same recipe can be used to pass data from Fragment back to host Activity or parent Fragment) implements this interface: class MyFragment extends Fragment implements MyDialogCallbackContract {....}

Upon creation of DialogFragment set your invoking Fragment as DialogFragment's target by calling myDialogFragment.setTargetFragment(this, 0);.

In your DialogFragment, get that fragment object with getTargetFragment(); and cast into the interface you created to ensure that fragments implements the interfce: MyDialogCallbackContract mHost = (MyDialogCallbackContract)getTargetFragment();. Note you will get ClassCastException if your target fragment is not implementing MyDialogCallbackContract interface, but I personally let my code crash here by not catching this exception, because this is what should never really.

When time comes, call methodToPassData() to pass data you want, i.e. like this ((MyDialogCallbackContract)getTargetFragment()).methodToPassDataBackToFragment(data);. If you did cast target fragment already in onAttach(), then this code would be just mHost.methodToPassDataBackToFragment(data);.

Voilà. You just successfully passed your data from dialog back to invoking fragment.

Email codedump link for How to send data from DialogFragment to a Fragment?