forked from upstream-mirrors/quik
Use broader contacts intent
This commit is contained in:
@@ -237,14 +237,9 @@ class Navigator @Inject constructor(
|
||||
}
|
||||
|
||||
fun addContact(address: String) {
|
||||
val uri = Uri.parse("tel: $address")
|
||||
var intent = Intent(ContactsContract.Intents.SHOW_OR_CREATE_CONTACT, uri)
|
||||
|
||||
if (intent.resolveActivity(context.packageManager) == null) {
|
||||
intent = Intent(Intent.ACTION_INSERT)
|
||||
.setType(ContactsContract.Contacts.CONTENT_TYPE)
|
||||
.putExtra(ContactsContract.Intents.Insert.PHONE, address)
|
||||
}
|
||||
val intent = Intent(Intent.ACTION_INSERT)
|
||||
.setType(ContactsContract.Contacts.CONTENT_TYPE)
|
||||
.putExtra(ContactsContract.Intents.Insert.PHONE, address)
|
||||
|
||||
startActivityExternal(intent)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user