user6597752
user6597752

Reputation: 190

Android Firebase ChildEventListener onChildRemoved dataSnapshot content

I have used firebase onChildAdded and onChildChanged both seem very important since they provide information through dataSnaphot object, but incase of onChildRemoved I'm wondering what its purpose is because already that child is gone and I am curious what the dataSnapshot provides.

Upvotes: 0

Views: 468

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 600131

From the Firebase documentation the DataSnapshot for onChildRemoved is:

An immutable snapshot of the data at the child that was removed.

So this contains the data that was removed. Mostly you'll use the key DataSnapshot.getKey() to remove the UI elements corresponding to the data.

Upvotes: 1

Related Questions