From 03d81be7a0fde56e65dacdce78500401eb85d5b8 Mon Sep 17 00:00:00 2001
From: pacien
Date: Sun, 4 Mar 2018 19:58:37 +0100
Subject: Use activity chooser
---
app/src/main/java/org/pacien/tincapp/context/App.kt | 7 +++++--
app/src/main/res/values/strings.xml | 1 +
2 files changed, 6 insertions(+), 2 deletions(-)
(limited to 'app/src')
diff --git a/app/src/main/java/org/pacien/tincapp/context/App.kt b/app/src/main/java/org/pacien/tincapp/context/App.kt
index 4a4a475..d79ae3e 100644
--- a/app/src/main/java/org/pacien/tincapp/context/App.kt
+++ b/app/src/main/java/org/pacien/tincapp/context/App.kt
@@ -35,7 +35,10 @@ class App : Application() {
.create().apply { window.setType(WindowManager.LayoutParams.TYPE_SYSTEM_ERROR) }.show()
}
- fun openURL(url: String) =
- appContext?.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK))
+ fun openURL(url: String) {
+ val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
+ val chooser = Intent.createChooser(intent, getResources().getString(R.string.action_open_web_page))
+ appContext?.startActivity(chooser.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK))
+ }
}
}
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 3301486..6dfcfb7 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -65,6 +65,7 @@
Apply
Encrypt or decrypt private keys
Dismiss
+ Open web page
No network configuration has been found.
Generating node configuration…
--
cgit v1.2.3