aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/org/pacien
diff options
context:
space:
mode:
authorpacien2018-03-04 19:58:37 +0100
committerpacien2018-03-04 19:58:37 +0100
commit03d81be7a0fde56e65dacdce78500401eb85d5b8 (patch)
tree5f4ef2f7c064015763b28fe936b661b44e8cafb1 /app/src/main/java/org/pacien
parent9c987682bde9f532f53f3f1ac3ade7e96a5e2293 (diff)
downloadtincapp-03d81be7a0fde56e65dacdce78500401eb85d5b8.tar.gz
Use activity chooser
Diffstat (limited to 'app/src/main/java/org/pacien')
-rw-r--r--app/src/main/java/org/pacien/tincapp/context/App.kt7
1 files changed, 5 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}