Skip to content Skip to sidebar Skip to footer

Firebase Database Data Retrieving -java

Here is my DB structure: Code which I used for data reading: user='hrcj7'; mDatabase = FirebaseDatabase.getInstance().getReference().child('User');

Solution 1:

Here I found the solution .

In line:

User dinosaur = dataSnapshot.getValue(User.class);

should be replaced as following:

Stringkey = mDatabase.child("User").child(user).push().getKey();
User dinosaur = dataSnapshot.child(key).getValue(User.class);

Post a Comment for "Firebase Database Data Retrieving -java"