Вот мой код: < /p>
Код: Выделить всё
val contactLauncher = rememberLauncherForActivityResult(object : ActivityResultContract() {
override fun parseResult(resultCode: Int, intent: Intent?): Uri? {
return if (resultCode == Activity.RESULT_OK) intent?.data else null
}
override fun createIntent(context: Context, input: Int?): Intent =
Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI).also {
it.type = ContactsContract.CommonDataKinds.Phone.CONTENT_TYPE
}
}) { uri ->
...
}
...
contactLauncher.launch(null)
Подробнее здесь: https://stackoverflow.com/questions/794 ... ck-compose