i'm trying to implement a code sample from Firebase Doc that Listen for child events,
val childEventListener = object : ChildEventListener {
override fun onChildAdded(dataSnapshot: DataSnapshot, previousChildName: String?) {
Log.d(TAG, "onChildAdded:" + dataSnapshot.key!!)
// A new comment has been added, add it to the displayed list
val comment = dataSnapshot.getValue<Comment>() // error line
// ...
}
...
...
when i tried it for my firebase, Android studio hints an error on val comment = dataSnapshot.getValue<Comment>()
Error: no type arguments expected for fun getValue: Any?
Can someone please explain the meaning of this error and how to get around it.