简体   繁体   English

在应用程序重启之前,Android RecyclerView不会加载Firebase项目

[英]Android RecyclerView does not load firebase items until application restart

I have a RecyclerView, which acts weird. 我有一个RecyclerView,这很奇怪。 I'm attaching it to data from a firebase database and there are no errors or crashses. 我将其附加到Firebase数据库的数据中,没有错误或崩溃。

I need to close the application compeletely and reopen it only one time after installing it and log in with an account, and then it will start loading (the RecyclerView is inside a SwipeRefreshLayout). 我需要完全关闭该应用程序,并在安装后仅一次将其重新打开并使用一个帐户登录,然后它将开始加载(RecyclerView位于SwipeRefreshLayout中)。

Actions and events step-by-step: 动作和事件分步进行:

  1. I install the app. 我安装了应用程序。
  2. Log in with existing account. 使用现有帐户登录。
  3. The RecyclerView gets the current data. RecyclerView获取当前数据。
  4. When swipeing down with SwipeRefreshLayout, the RecyclerView doesn't load any data. 使用SwipeRefreshLayout向下滑动时,RecyclerView不会加载任何数据。
  5. After i close the application (pressing mainmenu on the phone and closing the app) and reopen it, the problem disappears and the SwipeRefreshLayout works perfectly. 关闭应用程序(按电话上的主菜单并关闭应用程序)并重新打开后,问题消失了,并且SwipeRefreshLayout正常运行。
  6. When logging in with another account (for the first time), problem starts allover again. 使用其他帐户登录(第一次)时,问题再次开始。

I dont even know which code is doing that. 我什至不知道哪个代码正在执行此操作。

在数据库参考上应用onchildeventlistener

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM