5

Is it possible to make onDataChange() not be triggered just as you set the listener and instead only when the actual data changes?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
kmindspark
  • 487
  • 1
  • 7
  • 18
  • Do you mean so that if you have preexisting data in your Firebase database it won't download that data and only download data that's been stored since you initialized the Firebase listener? – Micah Simmons Jun 20 '16 at 23:51
  • A `ValueEventListener` is defined as being called for the current value and every change to that value. There is no way to change that behavior. This sounds like a[ XY problem](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem) though: what use-case are you trying to implement that makes you want to not receive the initial value? – Frank van Puffelen Jun 21 '16 at 00:09
  • 1
    @FrankvanPuffelen Consider an example of an App fetching the data and populating list from its own endpoint backed by its own master db(which is in sync with firebase db) and then once the changes are done to that data listen to onChild** events of firebase and update the list..Is that possible?Any idea how can we ignore initial onChildAdded() events of firebase db and only fetch the data from our endpoint at first attempt? – PunitD Aug 29 '16 at 12:22

1 Answers1

0

No it is not possible the way you want. the firebase listener starts just after you are authenticated and an eventlistener is setup .

AshisParajuli
  • 669
  • 6
  • 14