code: @Override
      public void onCreate(Bundle savedInstanceState)
      {
          super.onCreate(savedInstanceState);
  
          try
          {
              mCallback = (DateChangedListener) getTargetFragment();
          }
          catch (ClassCastException e)
          {
              throw new ClassCastException("Calling fragment must implement " +
                  "DateFragment.DateChangedListener interface");
          }
      }
docs: Cast the reference to {@link DateTimeDialogFragment}
  to a {@link DateChangedListener}.