mheadingReference1.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
for(DataSnapshot snapShot : dataSnapshot.getChildren()) {
Log.e("one", "======="+snapShot.child("id").getValue(String.class));
Log.e("one", "======="+snapShot.child("fullname").getValue(String.class));
Log.e("one", "======="+snapShot.child("password").getValue(String.class));
Log.e("one", "======="+snapShot.child("type").getValue(String.class));
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
我想从firebase获取值,我知道对象的键。喜欢" key:id" "价值:123456"。上面的代码显示NULL。我将如何获得价值,如输出" 123456"单独。提前致谢