I have a JSON array where I store a few items I want to display on my app's main menu. It looks like this:
I'd like to retrieve this list but for some reason I ignore the code below doesn't work:
DatabaseReference mRootRef = FirebaseDatabase.getInstance().getReference();
DatabaseReference mMainMenuRef = mRootRef.child("main_menu");
@Override
protected void onStart() {
super.onStart();
mAuth.addAuthStateListener(mAuthListener);
mMainMenuRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
for (DataSnapshot ds : dataSnapshot.getChildren()) {
String stringValue = ds.getValue(String.class);
Log.i("Firebase", stringValue);
}
}
...
});
