我在运行应用程序时遇到错误,它不断崩溃并给出此错误。
Process: com.ahmadtakkoush.source, PID: 29506
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.username.appname/com.username.appname.MainActivity}:
java.lang.IllegalStateException: FragmentManager is already executing transactions
这是一个代码示例 https://pastebin.com/ufF5LsbU
最佳答案
从 addSnapshotListener
监听器中删除 Objects.requireNonNull(getActivity())
并使用如下所示:
query.addSnapshotListener( new EventListener<QuerySnapshot>() {
// implementation here
});
使用 onPause()
上的 listener.remove
处理监听器分离。
//Stop listening to changes
registration.remove();
查看更多详情here
关于java.lang.IllegalStateException : FragmentManager is already executing transactions?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59592159/