Challenge problem: nCreateDialog v onCreateView

OK. I did get the Dialog to display as a Dialog and embedded in an Activity, I check the screen size and then check it in CrimeFragment to determine whether the emulator should display the Dialog alone or in the Activity:

            if (ScreenSize < 2080 ) {
                DatePickerFragment dialog =  DatePickerFragment
                dialog.setTargetFragment(CrimeFragment.this, REQUEST_DATE);
      , DIALOG_DATE);
            } else {
                date = mCrime.getDate();
                Intent intent = new Intent(getContext(), DatePickerActivity.class);
                intent.putExtra(EXTRA_DATE, date);
                startActivityForResult(intent, REQUEST_DATE);

However, I just found out that it crashes when the check results in the Dialog alone because it performs onCreateDialog and then onCreateView. When I set (ScreenSize >= 2080 ) it shows the Dialog embedded in an Activity without performing onCreateDialog.

If this challenge is supposed to produce the desired output, either the Dialog or the Activity with Dialog, depending on screen size, then how are we to deal with the way Android operates, preventing onCreateView from being entered when only a Dialog is to be shown?