Skip to content

Instantly share code, notes, and snippets.

@manuelernesto
Created January 15, 2019 16:11
Show Gist options
  • Save manuelernesto/92e73e25ea8276ea8d5714a5858164a6 to your computer and use it in GitHub Desktop.
Save manuelernesto/92e73e25ea8276ea8d5714a5858164a6 to your computer and use it in GitHub Desktop.
db.collection("Person").get().addOnSuccessListener { query ->
if (!query.isEmpty) {
val list = query.documents
for (d in list) {
val person: Person? = d.toObject(Person::class.java)
if (person != null) {
person.id = d.id
mPeople.add(person)
}
}
mAdapter.notifyDataSetChanged()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment