Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d1de606 authored by Moez Bhatti's avatar Moez Bhatti
Browse files

Use broader contacts intent

parent 11f032e4
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -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)
        val intent = Intent(Intent.ACTION_INSERT)
                .setType(ContactsContract.Contacts.CONTENT_TYPE)
                .putExtra(ContactsContract.Intents.Insert.PHONE, address)
        }

        startActivityExternal(intent)
    }