Difference between addValueEventListener () and addListenerForSingleValueEvent () from firebase

As the name says, I want to know the difference between addValueEventListener()and addListenerForSingleValueEvent()Firebase.

+4
source share
1 answer

addValueEventListener() Continue to listen to the query or link to the database to which it is bound.

But addListenerForSingleValueEvent()immediately it executes the method onDataChangeand after executing this method it stops listening to the link to which it is bound once.

+15
source

Source: https://habr.com/ru/post/1666428/


All Articles