Created
June 26, 2019 07:45
-
-
Save e-lin/faecedd5cb32f7430aea5a628cc50818 to your computer and use it in GitHub Desktop.
Fetch pic data from Firebase
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
private fun poplulateViews(picId: String) { | |
picReference = FirebaseFirestore.getInstance().collection("pics").document(picId) | |
picReference.get() | |
.addOnSuccessListener(this) { snap -> | |
if (snap.exists()) { | |
val ring = snap.toObject(Pic::class.java) | |
val ref = FirebaseStorage.getInstance().getReference(pic.imagePath!!) | |
Glide.with(this@AnswerPicActivity).load(ref).into(ivGuest) | |
} | |
} | |
.addOnFailureListener(this) { e -> | |
Log.e(TAG, "Cannot fetch pic $picId", e) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment