mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor: handle ActivityNotFoundException when opening URIs
This commit is contained in:
parent
6e3e173096
commit
9024d36985
1 changed files with 6 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package com.geeksville.mesh.ui
|
||||
|
||||
import android.content.ActivityNotFoundException
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.text.ClickableText
|
||||
import androidx.compose.material.MaterialTheme
|
||||
|
|
@ -55,7 +56,11 @@ fun LinkedCoordinates(
|
|||
debug("Clicked on link")
|
||||
annotatedString.getStringAnnotations(tag = "gps", start = offset, end = offset)
|
||||
.firstOrNull()?.let {
|
||||
uriHandler.openUri(it.item)
|
||||
try {
|
||||
uriHandler.openUri(it.item)
|
||||
} catch (ex: ActivityNotFoundException) {
|
||||
debug("No application found: $ex")
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue