Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private fun renderContact(uri: Uri?) {
- val contactNameView = findViewById<TextView>(R.id.contact_name)
- val contactPhoneView = findViewById<TextView>(R.id.contact_phone)
- val contactPhotoView = findViewById<ImageView>(R.id.contact_portrait)
- val name = uri?.let { getDisplayName(it, contentResolver) } ?: "Select a contact"
- val number = uri?.let { getMobileNumber(it, contentResolver) } ?: ""
- val photo = uri?.let { getPhoto(it, contentResolver)}
- contactNameView.setText(name)
- contactPhoneView.setText(number)
- contactPhotoView.setImageBitmap(photo)
- } // fun renderContact
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement