Android RecyclerView does not load firebase items until application restart

I have a RecyclerView, which acts weird. I’m attaching it to data from a firebase database and there are no errors or crashses.

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).

Actions and events step-by-step:

  1. I install the app.
  2. Log in with existing account.
  3. The RecyclerView gets the current data.
  4. When swipeing down with SwipeRefreshLayout, the RecyclerView doesn’t load any data.
  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.
  6. When logging in with another account (for the first time), problem starts allover again.

I dont even know which code is doing that.

1
Leave a Reply

avatar
1 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
Jason Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Jason
Guest

Apply onchildeventlistener on database reference