fix #111, just dial the phone number if Phone permission is not granted

This commit is contained in:
tibbi 2018-04-06 21:33:28 +02:00
parent 6695bf4f77
commit d3c87e241c
1 changed files with 7 additions and 8 deletions

View File

@ -20,14 +20,13 @@ import java.io.File
fun SimpleActivity.startCallIntent(recipient: String) {
handlePermission(PERMISSION_CALL_PHONE) {
if (it) {
Intent(Intent.ACTION_CALL).apply {
data = Uri.fromParts("tel", recipient, null)
if (resolveActivity(packageManager) != null) {
startActivity(this)
} else {
toast(R.string.no_app_found)
}
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)
}
}
}