Skip to content Skip to sidebar Skip to footer

Cannot Retrieve A List Into Firebase Database

I am currently working on a project with Firebase Database and I cannot retrieve data as a list. Here a sample of the json I have imported into firebase : { 'mood' : [ { 'dat

Solution 1:

you need to access list of results in onDataChange as follows (this is in Java so will let you convert to Kotlin :) )

                for (DataSnapshot childSnapshot: dataSnapshot.getChildren()) {
                    Book book = childSnapshot.getValue(Book.class);
                }

Post a Comment for "Cannot Retrieve A List Into Firebase Database"