Android Firebase - setPersistenceEnabled(true) crashing the app

前端 未结 5 1531
伪装坚强ぢ
伪装坚强ぢ 2021-01-25 01:00

So I was just trying out Firebase to update Toolbar label of activities from realtime database. I am getting the following error:

12-21 00:25:19.890 10295-10295/         


        
5条回答
  •  渐次进展
    2021-01-25 01:42

    This part mFirebaseInstance.setPersistenceEnabled(true); should be just in first Activity. It's shouldn't be called more than once.

    Better solution would be to put that line in onCreate method of your Application class. You can read more about it here.

提交回复
热议问题