Q:

Attempt to invoke interface method on a null object reference while implement interface

public class forgetPassword extends AppCompatDialogFragment {

    public
interface OnClickListener {
        void onClick(String email);
    }

    private OnClickListener mListener;

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        if (context instanceof OnClickListener) {
            mListener =