code: @SuppressWarnings("unchecked") // we know the dialog fragment is a child of fragment.
      public static <F extends android.support.v4.app.DialogFragment> F supportFindDialogFragmentByTag(android.support.v4.app.FragmentManager manager, String tag) {
          return (F) manager.findFragmentByTag(tag);
      }
docs: Find fragment registered on the manager.
  @param manager the manager.
  @param tag the tag string that is related to the {@link android.support.v4.app.DialogFragment}.
  @param <F> the dialog fragment impl.
  @return the {@link android.support.v4.app.DialogFragment}. {@code null} if the fragment not found.