我在 android v2.2.0 上使用 firebase 该应用程序大部分时间都运行良好。 但是当我长时间离开应用程序(比方说 2-3 小时以上)并返回应用程序时,它很可能会出错。
并发送错误报告以始终检查此报告。
Caused by: java.lang.RuntimeException: You need to set the Android context using Firebase.setAndroidContext() before using Firebase.
我已经在 onCreate() 的顶部设置了;在每项 Activity 上作为 www.firebase.com 的安装指南
@Override
public void onCreate() {
super.onCreate();
Firebase.setAndroidContext(this);
// other setup code
}
我应该修复什么?
最佳答案
In the new SDK, it's no longer necessary to call Firebase.setAndroidContext() so you can remove it from your code.
关于java - Firebase Android "using Firebase.setAndroidContext() before using Firebase."错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33250100/