Android Studio:无法在频道“null”上发布通知

时间:2017-11-17 12:45:48

标签: java firebase android-studio-3.0

在我的应用上填写Editext后尝试按下注册/登录按钮时出现此错误:

developer warning for package "com.longkai"
Failed to post notification on channel "null"

CustomerLoginActivity:

    mEmail = (EditText) findViewById(R.id.email);
    mPassword = (EditText) findViewById(R.id.password);

    mLogin = findViewById(R.id.login);
    mRegistration = findViewById(R.id.registration);

    mRegistration.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            final String email = mEmail.getText().toString();
            final String password = mPassword.getText().toString();
            mAuth.createUserWithEmailAndPassword(email,password).addOnCompleteListener(CustomerLoginActivity.this, new OnCompleteListener<AuthResult>() {
                @Override
                public void onComplete(@NonNull Task task) {
                    if(!task.isSuccessful()){
                        Toast.makeText(CustomerLoginActivity.this, "sign up error", Toast.LENGTH_SHORT).show();
                    }else {
                        String user_id = mAuth.getCurrentUser().getUid();
                        DatabaseReference current_user_db = FirebaseDatabase.getInstance().getReference().child("Users").child("Customers").child(user_id);
                        current_user_db.setValue(true);
                    }
                }
            });
        }
    });
    mLogin.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            final String email = mEmail.getText().toString();
            final String password = mPassword.getText().toString();
            mAuth.signInWithEmailAndPassword(email,password).addOnCompleteListener(CustomerLoginActivity.this, new OnCompleteListener<AuthResult>() {
                @Override
                public void onComplete(@NonNull Task<AuthResult> task) {
                    if(!task.isSuccessful()){
                        Toast.makeText(CustomerLoginActivity.this, "sign in error", Toast.LENGTH_SHORT).show();
                    }
                }
            });
        }
    });

0 个答案:

没有答案