forked from github/wulkanowy-mirror
Fix crash in school info when dialer is unavailable (#1500)
This commit is contained in:
parent
e665a8f18b
commit
8528e0beff
@ -102,8 +102,10 @@ fun Context.openNavigation(location: String) {
|
|||||||
fun Context.openDialer(phone: String) {
|
fun Context.openDialer(phone: String) {
|
||||||
val intentUri = Uri.parse("tel:$phone")
|
val intentUri = Uri.parse("tel:$phone")
|
||||||
val intent = Intent(Intent.ACTION_DIAL, intentUri)
|
val intent = Intent(Intent.ACTION_DIAL, intentUri)
|
||||||
|
if (intent.resolveActivity(packageManager) != null) {
|
||||||
startActivity(intent)
|
startActivity(intent)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun Context.shareText(text: String, subject: String?) {
|
fun Context.shareText(text: String, subject: String?) {
|
||||||
val sendIntent: Intent = Intent().apply {
|
val sendIntent: Intent = Intent().apply {
|
||||||
|
Loading…
Reference in New Issue
Block a user