我收到此运行时错误,我不明白其背后的原因。
com.google.firebase.firestore.FirebaseFirestoreException: Failed to get document because the client is offline.
下面是我的 Activity 中尝试从云 Firestore 获取数据的代码
DocumentReference docRef = db.collection("room-id-1").document("participan-name-1");
docRef.get().addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {
@Override
public void onComplete(@NonNull Task<DocumentSnapshot> task) {
if (task.isSuccessful()) {
DocumentSnapshot document = task.getResult();
if (document != null) {
Log.d(TAG, "DocumentSnapshot data: " + task.getResult().getData());
userData.registerUserToHotspot(roomId_str, participantName_str);
} else {
Log.d(TAG, "No such document");
}
} else {
Log.d(TAG, "get failed with ", task.getException());
}
}
});
对此我能做些什么吗?