Cannot resolve method, why?
<p>The method <code>setDateListener(DateListener dl)</code> cannot be resolved. It is public and I am using it on an object of the class DatePickerFragment.java where the method is contained.    </p>

<p>Here is the <code>onCreateView()</code> method in the fragment where the <code>setDateListener()</code> method is called:</p>

<pre><code>@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    mView = inflater.inflate(R.layout.fragment_sign_up_about, container, false);

    mFirstNameEditText = (EditText) mView.findViewById(R.id.sign_up_first_name_edit_text);
    mLastNameEditText = (EditText) mView.findViewById(R.id.sign_up_last_name_edit_text);
    mBirthdayEditText = (EditText) mView.findViewById(R.id.sign_up_birthday_edit_text);
    mContinueButton = (Button) mView.findViewById(R.id.sign_up_continue_2_button);

    mBirthdayEditText.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            datePickerFragment = new DatePickerFragment();
            datePickerFragment.setDateListener(SignUpAboutFragment.this);
            datePickerFragment.show(getFragmentManager(), "datePicker");

        }
    });
}
</code></pre>

<p>Here is the <strong>DatePickerFragment.java</strong> class (imports have been omitted):</p>

<pre><code>public class DatePickerFragment extends DialogFragment
        implements DatePickerDialog.OnDateSetListener {

    private DateListener mCallback;

    public interface DateListener {
        void onDateSelected(String formattedDate);
    }

    @NonNull
    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        // Use the current date as the default date in the picker
        final Calendar c = Calendar.getInstance();
        int year = c.get(Calendar.YEAR);
        int month = c.get(Calendar.MONTH);
        int day = c.get(Calendar.DAY_OF_MONTH);

        // Create a new instance of DatePickerDialog and return it
        return new DatePickerDialog(getActivity(), this, year, month, day);
    }

    @Override
    public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
        Calendar c = Calendar.getInstance();
        c.set(year, monthOfYear, dayOfMonth);

        SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
        String formattedDate = sdf.format(c.getTime());
        mCallback.onDateSelected(formattedDate);
    }

    public void setDateListener(DateListener dateListener) {
        mCallback = dateListener;
    }
}
</code></pre>