1
如何將push()添加到航點的孩子?不能得到它的權利..Android與Firebase,如何推動兒童數據?
Map mWaypoints = new HashMap();
mWaypoints.put("latitude", mCurrentLatlngOnCreate.latitude);
mWaypoints.put("longitude", mCurrentLatlngOnCreate.longitude);
Map mParent = new HashMap();
mParent.put("routeID", "my route id");
mParent.put("routeName", "my route name");
mParent.put("Waypoints", mWaypoints);
myFirebaseRef.push().setValue(mParent);
這裏是當前的結果,但希望有下面的推送ID Waypoints。
-KGNWnjgXPC0kHYiOKG7
Waypoints // <--- Want to get the unique below here
latitude: 31
longitude: 421
routeID: "my route id"
routeName: "my route name"