Skip to content

Instantly share code, notes, and snippets.

@Alpha-Rome0
Created September 16, 2017 12:26
Show Gist options
  • Save Alpha-Rome0/000a8a8b35890186f9247c1dfb25a69b to your computer and use it in GitHub Desktop.
Save Alpha-Rome0/000a8a8b35890186f9247c1dfb25a69b to your computer and use it in GitHub Desktop.
chatgt code
// Read from the database
ChildEventListener childEventListener = new ChildEventListener() {
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String previousChildName) {
//TODO implement me
}
@Override
public void onChildChanged(DataSnapshot dataSnapshot, String previousChildName) {
}
@Override
public void onChildRemoved(DataSnapshot dataSnapshot) {
}
@Override
public void onChildMoved(DataSnapshot dataSnapshot, String previousChildName) {
}
@Override
public void onCancelled(DatabaseError databaseError) {
Log.w(TAG, "postComments:onCancelled", databaseError.toException());
}
};
myRef.addChildEventListener(childEventListener);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment