事件处理程序 onComplete 控制器不会执行 task.isSuccessful()。

huangapple go评论82阅读模式
英文:

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&lt;AuthResult&gt;() {

                    @Override
                    public void onComplete(@NonNull Task&lt;AuthResult&gt; task) {
    
                        if (task.isSuccessful()){

                        }
                    }
                });
    }


</details>


# 答案1
**得分**: 1

我不需要翻译的部分。以下是已翻译的内容:

我不得不将清单文件中的结束标签从&lt;改为/&gt;。问题得到了解决。

<details>
<summary>英文:</summary>

I had to change the end tag from to /&gt; in the manifest file. That fixed it.

</details>



huangapple
  • 本文由 发表于 2020年6月29日 06:13:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/62628768.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定