diff options
author | pacien | 2018-03-04 19:58:37 +0100 |
---|---|---|
committer | pacien | 2018-03-04 19:58:37 +0100 |
commit | 03d81be7a0fde56e65dacdce78500401eb85d5b8 (patch) | |
tree | 5f4ef2f7c064015763b28fe936b661b44e8cafb1 /app/src/main | |
parent | 9c987682bde9f532f53f3f1ac3ade7e96a5e2293 (diff) | |
download | tincapp-03d81be7a0fde56e65dacdce78500401eb85d5b8.tar.gz |
Use activity chooser
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/org/pacien/tincapp/context/App.kt | 7 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 1 |
2 files changed, 6 insertions, 2 deletions
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() { | |||
35 | .create().apply { window.setType(WindowManager.LayoutParams.TYPE_SYSTEM_ERROR) }.show() | 35 | .create().apply { window.setType(WindowManager.LayoutParams.TYPE_SYSTEM_ERROR) }.show() |
36 | } | 36 | } |
37 | 37 | ||
38 | fun openURL(url: String) = | 38 | fun openURL(url: String) { |
39 | appContext?.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)) | 39 | val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url)) |
40 | val chooser = Intent.createChooser(intent, getResources().getString(R.string.action_open_web_page)) | ||
41 | appContext?.startActivity(chooser.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)) | ||
42 | } | ||
40 | } | 43 | } |
41 | } | 44 | } |
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 @@ | |||
65 | <string name="action_apply">Apply</string> | 65 | <string name="action_apply">Apply</string> |
66 | <string name="action_encrypt_decrypt_private_keys">Encrypt or decrypt private keys</string> | 66 | <string name="action_encrypt_decrypt_private_keys">Encrypt or decrypt private keys</string> |
67 | <string name="action_dismiss">Dismiss</string> | 67 | <string name="action_dismiss">Dismiss</string> |
68 | <string name="action_open_web_page">Open web page</string> | ||
68 | 69 | ||
69 | <string name="message_no_network_configuration_found">No network configuration has been found.</string> | 70 | <string name="message_no_network_configuration_found">No network configuration has been found.</string> |
70 | <string name="message_generating_configuration">Generating node configuration…</string> | 71 | <string name="message_generating_configuration">Generating node configuration…</string> |