Where to put Firebase.setAndroidContext() function

后端 未结 6 1464
长发绾君心
长发绾君心 2020-12-20 15:57

I\'m trying to play a bit with Firebase and Android.
I have one RegisterActivity, and one MainActivity. My current flow is - start with M

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-20 16:36

    Replace Firebase.setAndroidContext(this); code with mRef = FirebaseDatabase.getInstance().getReference();

    And add private DatabaseReference mRef; before onCreate methode.

    I hope this will work for Android Studio 3.5 version.

提交回复
热议问题