mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-06-05 21:59:27 +02:00
add website to the View screen
This commit is contained in:
@ -68,11 +68,23 @@ fun Context.sendAddressIntent(address: String) {
|
||||
val location = Uri.encode(address)
|
||||
val uri = Uri.parse("geo:0,0?q=$location")
|
||||
|
||||
val intent = Intent(Intent.ACTION_VIEW, uri)
|
||||
if (intent.resolveActivity(packageManager) != null) {
|
||||
startActivity(intent)
|
||||
} else {
|
||||
toast(R.string.no_app_found)
|
||||
Intent(Intent.ACTION_VIEW, uri).apply {
|
||||
if (resolveActivity(packageManager) != null) {
|
||||
startActivity(this)
|
||||
} else {
|
||||
toast(R.string.no_app_found)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun Context.openWebsiteIntent(url: String) {
|
||||
Intent(Intent.ACTION_VIEW).apply {
|
||||
data = Uri.parse(url)
|
||||
if (resolveActivity(packageManager) != null) {
|
||||
startActivity(this)
|
||||
} else {
|
||||
toast(R.string.no_app_found)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user