英文:
Event Handler onComplete controller is not going to task.isSuccessful()
问题
在下面的代码中,它正在进入onComplete
方法,但没有进入if(task.isSuccessful())
条件。有没有办法知道它在哪里失败,并且如何修复这个问题?
private void register(final String username, String fullname, String email, String password){
auth.createUserWithEmailAndPassword(email, password)
.addOnCompleteListener(RegisterActivity.this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()){
}
}
});
}
英文:
In the below code, it is entering onComplete but is not entering if(task.isSuccessful()). Is there any way to know where it is failing, and how can I fix this?
private void register (final String username, String fullname, String email, String password){
auth.createUserWithEmailAndPassword(email, password)
.addOnCompleteListener(RegisterActivity.this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()){
}
}
});
}
</details>
# 答案1
**得分**: 1
我不需要翻译的部分。以下是已翻译的内容:
我不得不将清单文件中的结束标签从<改为/>。问题得到了解决。
<details>
<summary>英文:</summary>
I had to change the end tag from to /> in the manifest file. That fixed it.
</details>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论