fix #82, allow pressing phone number, email, address on the View screen

This commit is contained in:
tibbi
2018-03-16 13:33:03 +01:00
parent 1165550ef4
commit 4bd4513ad9
5 changed files with 36 additions and 6 deletions

View File

@ -61,6 +61,18 @@ fun Context.sendSMSIntent(recipient: String) {
}
}
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)
}
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
fun Context.getLookupUriRawId(dataUri: Uri): Int {
val lookupKey = getLookupKeyFromUri(dataUri)