java - 如何从 FireStore 读取 ArrayList?
问题描述
如果我的 FirebaseFireStore 中有完整的 ArrayList,如何将其读取到本地 ArrayList,我的意思是我应该使用什么函数?
public void stuArr() {
noteRef.get()
.addOnSuccessListener(new OnSuccessListener<DocumentSnapshot>() {
@Override
public void onSuccess(DocumentSnapshot documentSnapshot) {
if (documentSnapshot.exists()) {
studentArrayList.add(documentSnapshot.getString("studentArrayList"));
}
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Toast.makeText(getActivity() , "Error!", Toast.LENGTH_SHORT).show();
Log.d("TAG", e.toString());
}
});
}
解决方案
推荐阅读
- javascript - 为什么 S3 文件上传后有前缀?
- makefile - 驱动程序未编译“没有规则来制作目标”
- reactjs - 如何通过按钮清除reactjs中的传单地图?
- tensorflow - 使用 tf.keras.preprocessing.image_dataset_from_directory() 时如何在预测期间获取文件名?
- python - 无法将该列更新为从 perforce 签出的 excel 文件
- android - 如何在约束布局中动态更改 android:layout_below?
- r - R:聚合(来自 stats v3.6.2)无法正常工作
- postgresql - 在 postgres 查询中使用函数会跳过索引。使用应用了索引的函数的任何解决方案
- typescript - TypeScript:使用单点控制创建类属性
- google-apps-script - Google 应用程序脚本:使用自定义消息共享文件