Stay organized with collections Save and categorize content based on your preferences.
ChildEventListenerpublic interface ChildEventListener
Classes implementing this interface can be used to receive events about changes in the child locations of a given DatabaseReference
ref. Attach the listener to a location using addChildEventListener
and the appropriate method will be triggered when changes occur.
abstract void onCancelled(@NonNull DatabaseError error)
This method will be triggered in the event that this listener either failed at the server, or is removed as a result of the security and Firebase rules. For more information on securing your data, see: Security Quickstart
onChildAddedabstract void onChildAdded(
@NonNull DataSnapshot snapshot,
@Nullable String previousChildName
)
This method is triggered when a new child is added to the location to which this listener was added.
Parameters@NonNull DataSnapshot snapshot
An immutable snapshot of the data at the new child location
@Nullable String previousChildName
The key name of sibling location ordered before the new child. This will be null for the first child node of a location.
onChildChangedabstract void onChildChanged(
@NonNull DataSnapshot snapshot,
@Nullable String previousChildName
)
This method is triggered when the data at a child location has changed.
Parameters@NonNull DataSnapshot snapshot
An immutable snapshot of the data at the new data at the child location
@Nullable String previousChildName
The key name of sibling location ordered before the child. This will be null for the first child node of a location.
onChildMovedabstract void onChildMoved(
@NonNull DataSnapshot snapshot,
@Nullable String previousChildName
)
This method is triggered when a child location's priority changes. See setPriority
and Ordered Data for more information on priorities and ordering data.
@NonNull DataSnapshot snapshot
An immutable snapshot of the data at the location that moved.
@Nullable String previousChildName
The key name of the sibling location ordered before the child location. This will be null if this location is ordered first.
onChildRemovedabstract void onChildRemoved(@NonNull DataSnapshot snapshot)
This method is triggered when a child is removed from the location to which this listener was added.
Parameters@NonNull DataSnapshot snapshot
An immutable snapshot of the data at the child that was removed.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-21 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-21 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4