Ant*_*oco -2 android firebase firebase-realtime-database
如何获得按键(用蓝色笔突出显示的按键)?我想获取该值,以便更改subjectName子级的值。

如果要在写操作之前知道按键值是多少,则必须执行以下操作:
//get the push key value
String key = mDatabase.child("posts").push().getKey();
//then you can write in that node in this way
mDatabase.child("posts").child(key).setValue(yourValue)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2499 次 |
| 最近记录: |