Java 如何使用fireauth进行确认登录以确认密码为真
首先,我想用fireauth检查密码和电子邮件是否正确。如果密码与fireauth不同,则会弹出toastJava 如何使用fireauth进行确认登录以确认密码为真,java,android,firebase,firebase-authentication,Java,Android,Firebase,Firebase Authentication,首先,我想用fireauth检查密码和电子邮件是否正确。如果密码与fireauth不同,则会弹出toast firebaseAuth.signInWithEmailAndPassword(email,password) .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() { @Override public void
firebaseAuth.signInWithEmailAndPassword(email,password)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
progressDialog.dismiss();
if(task.isSuccessful()){
finish();
if(!password.equals()){
}
userVerified();
}else{
Toast.makeText(Signin.this, "Your account not registered",Toast.LENGTH_LONG).show();
startActivity(new Intent(getApplicationContext(),Signup.class));
}
}
});
}
firebaseAuth.signiWithEmailandPassword(电子邮件,密码)
.addOnCompleteListener(这是新的OnCompleteListener(){
@凌驾
未完成的公共void(@NonNull任务){
progressDialog.disclose();
if(task.issusccessful()){
完成();
如果(!password.equals()){
}
userVerified();
}否则{
Toast.makeText(签名为“您的帐户未注册”,Toast.LENGTH_LONG.show();
startActivity(新意图(getApplicationContext(),Signup.class));
}
}
});
}
我坚持使用密码。我不知道如何与fireauth匹配。任务。getException()提供登录失败的确切错误,因此在Toast消息的else部分,您可以打印异常消息。如果有帮助,一定要告诉我。非常感谢,我会先试试