I'm tying to get from my firebase realtime database list of data. Here is my code:
firebaseDatabase.child(NEWS_LIST).get().addOnSuccessListener {
result = Result.success(it.getValue(List<NewsModel>::class.java))
}.addOnFailureListener {
result = generateErrorResult(it)
}
But when I try to retrieve value from my DataSnapshot I get error:
Only classes are allowed on the left hand side of a class literal
I also tried:
it.getValue(object : TypeToken<List<NewsModel>>() {}.type)
None of the following functions can be called with the arguments supplied.
Is it possible to somehow fix this error? Please help me