我正在尝试进行一项显示课程并将其列在回收站视图中的活动。但是,我在从 firebase 查询数据时遇到问题。在我展示我的数据库结构后,我会解释更多。这是我的数据库结构:
"Classes": {
"-Li9nBUgnFmCWqUmwV5W": {
"class_info": {
"date_clasname": "August 6, 2019",
"room_number": "131",
"subject": "Science",
"teacher": "Ms.Henry",
"id": "-Li9nBUgnFmCWqUmwV5W"
}
},
"-Li9n_IYwbTNPdNAsTAu": {
"class_info": {
"date_clasname": "August 6, 2019",
"room_number": "131",
"subject": "Math",
"teacher": "Ms.Henry",
"id": "-Li9n_IYwbTNPdNAsTAu"
}
},
"-Li9naUipsa865NBpZjW": {
"class_info": {
"date_clasname": "August 6, 2019",
"room_number": "131",
"subject": "Other",
"teacher": "Ms.Henry",
"id": "-Li9naUipsa865NBpZjW"
}
},
"-Li9nbpwp2qchwmZRDP9": {
"class_info": {
"date_clasname": "August 6, 2019",
"room_number": "131",
"subject": "Technology",
"teacher": "Ms.Henry",
"id": "-Li9nbpwp2qchwmZRDP9"
}
},
"-Li9ne0NDyjcB4SIWi1z": {
"class_info": {
"date_clasname": "August 6, 2019",
"room_number": "131",
"subject": "Social Studies",
"teacher": "Ms.Henry",
"id": "-Li9ne0NDyjcB4SIWi1z"
}
}
},
我想我的问题可能是我无法获取随机生成的 ID 并将其设置为我的孩子,然后再在我的 onChildAdded 中将其设置为我的另一个孩子“class_info”。谢谢你!
慕的地8271018
相关分类