Daan
Daan

Reputation: 73

onDataChange() called twice if Double value in object set to 0 or 0.00

I have a Double value inside an object which I sync to Firebase using setValue(). The weird thing is that if the Double value is set to 0 or 0.00, the onDataChange() method gets called twice. I have replicated this hundred of times and can't seem to get my head it as to why it would do such thing. Is this a bug or am I going nuts?

I'm using the latest dependency which is 10.2.0.

Upvotes: 0

Views: 312

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317487

This is a known problem that exists when setting any double with a non-fractional decimal. It has to do with the coercion of that double value to a long. It should be fixed in a future release of the SDK.

Upvotes: 5

Related Questions