improving some intent handling for Android 11+

This commit is contained in:
tibbi
2021-04-04 09:15:50 +02:00
parent b5ed7944f0
commit c459cda972
6 changed files with 33 additions and 49 deletions

View File

@ -21,12 +21,7 @@ fun SimpleActivity.startCallIntent(recipient: String) {
val action = if (it) Intent.ACTION_CALL else Intent.ACTION_DIAL
Intent(action).apply {
data = Uri.fromParts("tel", recipient, null)
if (resolveActivity(packageManager) != null) {
startActivity(this)
} else {
toast(R.string.no_app_found)
}
launchActivityIntent(this)
}
}
}