Skip to content Skip to sidebar Skip to footer

Retrieving Values From Firebasedatabase

I have a Firebase realtime database, and I add value to it, I then want to retrieve those values, but they don't show up on my screen. here is the old code that works; //ChatAc

Solution 1:

To solve this, add the following lines of code in the onStart() and onStop() methods.

@OverrideprotectedvoidonStart() {
    super.onStart();
    allChatMessagesAdapter.startListening();
}

@OverrideprotectedvoidonStop() {
    super.onStop();
    if(allChatMessagesAdapter != null) {
            allChatMessagesAdapter.stopListening();
    }
}

In order to make it work, you need to start listening for changes.

Post a Comment for "Retrieving Values From Firebasedatabase"