![](/img/trans.png)
[英]On Android, is it necessary to remove a sensor listener when an activity is destroyed?
[英]Is it really necessary to remove the complete listener Firebase Authentication?
如我的标题所述,是否有必要删除完整的侦听器或将this
作为第一个参数传递,以便删除附加到signInWithCredential
函数的完整侦听器?
auth.signInWithCredential(credential).addOnCompleteListener(this, ...)
如果是,如何在不通过this
情况下删除监听器?
不必删除监听器。 实际上,不可能删除添加到由异步操作返回的Task的侦听器。 通过传递this
(我认为这意味着您当前的活动),您是在告诉Task API您不想在活动销毁后处理登录结果。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.