电子邮件和密码的Firebase身份验证(无法解析符号)

时间:2018-10-21 16:49:35

标签: java android firebase-authentication

我遇到了以下代码段的问题。我遵循了Google Firebase的教程,但该方法不起作用。 signInWithEmailAndPassword和任务的符号无法解析。谢谢大家对高级的帮助!

mAuth.signInWithEmailAndPassword(EmailField, PasswordField)
            .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
        @Override
        public void onComplete(@NonNull Task<AuthResult> task) {
            if (task.isSuccessful()) {
                // Sign in success, update UI with the signed-in user's information
                Log.d(TAG, "signInWithEmail:success");
                FirebaseUser user = mAuth.getCurrentUser();
                updateUI(user);
            } else {
                // If sign in fails, display a message to the user.
                Log.w(TAG, "signInWithEmail:failure", task.getException());
                Toast.makeText(LoginActivity.this, "Authentication failed.",
                        Toast.LENGTH_SHORT).show();
                updateUI(null);
            }

            // ...
        }
    });

0 个答案:

没有答案