mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-03-27 16:40:03 +01:00
properly handle launching the dialpad intent on Android 11
This commit is contained in:
parent
7220062283
commit
b5ed7944f0
@ -3,6 +3,7 @@ package com.simplemobiletools.contacts.pro.activities
|
|||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.app.SearchManager
|
import android.app.SearchManager
|
||||||
|
import android.content.ActivityNotFoundException
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.pm.ShortcutInfo
|
import android.content.pm.ShortcutInfo
|
||||||
@ -417,10 +418,12 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
|||||||
|
|
||||||
private fun launchDialpad() {
|
private fun launchDialpad() {
|
||||||
Intent(Intent.ACTION_DIAL).apply {
|
Intent(Intent.ACTION_DIAL).apply {
|
||||||
if (resolveActivity(packageManager) != null) {
|
try {
|
||||||
startActivity(this)
|
startActivity(this)
|
||||||
} else {
|
} catch (e: ActivityNotFoundException) {
|
||||||
toast(R.string.no_app_found)
|
toast(R.string.no_app_found)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
showErrorToast(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user