catching an exceptions thrown if no app can handle Dialpad

This commit is contained in:
tibbi
2020-05-25 12:12:45 +02:00
parent 3e5bbd69c8
commit e903a6f16e
3 changed files with 7 additions and 3 deletions

View File

@ -438,7 +438,11 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
private fun launchDialpad() {
Intent(Intent.ACTION_DIAL).apply {
startActivity(this)
if (resolveActivity(packageManager) != null) {
startActivity(this)
} else {
toast(R.string.no_app_found)
}
}
}