Created
March 5, 2020 22:52
-
-
Save gastsail/b38f4f3244fc0e01d8e4c58145255080 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val postListener = object : ValueEventListener { | |
override fun onDataChange(dataSnapshot: DataSnapshot) { | |
// Get Post object and use the values to update the UI | |
val post = dataSnapshot.getValue(Post::class.java) | |
// ... | |
} | |
override fun onCancelled(databaseError: DatabaseError) { | |
// Getting Post failed, log a message | |
Log.w(TAG, "loadPost:onCancelled", databaseError.toException()) | |
// ... | |
} | |
} | |
postReference.addValueEventListener(postListener) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment