Skip to content

Commit 3e5bbd6

Browse files
committed
replace Dial intent with Call
1 parent e98f6c6 commit 3e5bbd6

File tree

1 file changed

+12
-1
lines changed
  • app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions

1 file changed

+12
-1
lines changed

app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Activity.kt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.simplemobiletools.contacts.pro.extensions
22

3+
import android.content.Intent
4+
import android.net.Uri
35
import com.simplemobiletools.commons.activities.BaseSimpleActivity
46
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
57
import com.simplemobiletools.commons.extensions.*
@@ -12,7 +14,16 @@ import com.simplemobiletools.contacts.pro.helpers.*
1214
import com.simplemobiletools.contacts.pro.models.Contact
1315

1416
fun SimpleActivity.startCallIntent(recipient: String) {
15-
launchCallIntent(recipient, null)
17+
val action = Intent.ACTION_CALL
18+
Intent(action).apply {
19+
data = Uri.fromParts("tel", recipient, null)
20+
21+
if (resolveActivity(packageManager) != null) {
22+
startActivity(this)
23+
} else {
24+
toast(R.string.no_app_found)
25+
}
26+
}
1627
}
1728

1829
fun SimpleActivity.tryStartCall(contact: Contact) {

0 commit comments

Comments
 (0)