Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/211.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 需要在firebase auth中创建用户的帮助吗_Java_Android_Firebase_Firebase Authentication - Fatal编程技术网

Java 需要在firebase auth中创建用户的帮助吗

Java 需要在firebase auth中创建用户的帮助吗,java,android,firebase,firebase-authentication,Java,Android,Firebase,Firebase Authentication,我在firebase的一个项目中工作,在创建用户时遇到了一些问题。 这是我的代码: private void createAccount(String email, String password) { Log.d(TAG, "createAccount:" + email); mAuth.createUserWithEmailAndPassword(email, password).addOnCompleteListener(this, new OnCompleteListen

我在firebase的一个项目中工作,在创建用户时遇到了一些问题。 这是我的代码:

private void createAccount(String email, String password) {
    Log.d(TAG, "createAccount:" + email);
    mAuth.createUserWithEmailAndPassword(email, password).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
                @Override
                public void onComplete(@NonNull Task<AuthResult> task) {
                    if (task.isSuccessful()) {
                        Log.d(TAG, "createUserWithEmail:success");
                        FirebaseUser user = mAuth.getCurrentUser();
                    }
                    else {
                        Log.w(TAG, "createUserWithEmail:failure", task.getException());
                        Toast.makeText(getApplicationContext(), "Authentication failed.", Toast.LENGTH_SHORT).show();
                    }
                }
            });
}
private void createAccount(字符串电子邮件、字符串密码){
Log.d(标记“createAccount:”+电子邮件);
mAuth.createUserWithEmailAndPassword(电子邮件,密码).addOnCompleteListener(这是新的OnCompleteListener()){
@凌驾
未完成的公共void(@NonNull任务){
if(task.issusccessful()){
Log.d(标记“createUserWithEmail:success”);
FirebaseUser=mAuth.getCurrentUser();
}
否则{
w(标记“createUserWithEmail:failure”,task.getException());
Toast.makeText(getApplicationContext(),“身份验证失败”,Toast.LENGTH\u SHORT.show();
}
}
});
}

您遇到了什么问题?您没有提到您遇到了什么问题使用此代码时出现了什么问题?请回复@AlexMamo