【发布时间】:2018-10-14 12:43:44
【问题描述】:
我有一个如下的对象数据结构:
这些是我检索文档数据的代码:
DocumentReference docRef = db.collection("deyaPayUsers").document(mAuth.getUid()).collection("Split").document(mAuth.getUid()).collection("SentInvitations").document(documentId);
docRef.get().addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {
@Override
public void onComplete(@NonNull Task<DocumentSnapshot> task) {
if (task.isSuccessful()) {
DocumentSnapshot document = task.getResult();
if (document.exists()) {
Log.d(TAG, "DocumentSnapshot data: " + document.getData());
Object value = document.getData();// Here I added the data to the object type value
System.out.println("values"+ value);
} else {
Log.d(TAG, "No such document");
}
} else {
Log.d(TAG, "get failed with ", task.getException());
}
}
});
我已从 Firestore 数据库中检索到这些数据。现在我需要所有 Invite(1,2) 中的金额、电话号码和状态并添加到列表视图中。 我无法首先获得这些字段。之后,我需要将它们添加到列表视图。而且每当用户更新字段状态时,列表视图也应该更新。
【问题讨论】:
-
这不是我检索文档数据后的问题,我需要获取值
标签: java android firebase google-cloud-firestore