Improve openUrlInExternalApp API and move url to UnifiedPushConfig

This commit is contained in:
Benoit Marty 2024-03-28 09:31:09 +01:00 committed by Benoit Marty
parent a89dde2bb4
commit 565e5ce87d
3 changed files with 5 additions and 4 deletions

View file

@ -156,10 +156,9 @@ fun Context.startSharePlainTextIntent(
fun Context.openUrlInExternalApp(
url: String,
errorMessage: String = getString(R.string.error_no_compatible_app_found),
inNewTask: Boolean = false,
) {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
if (inNewTask) {
if (this !is Activity) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
try {