diff options
| author | Albin <albin@mullvad.net> | 2022-07-21 17:50:47 +0200 |
|---|---|---|
| committer | Albin <albin@mullvad.net> | 2022-07-21 17:50:47 +0200 |
| commit | 95554b61f7752b963d03cd96088de8ce2b8d172b (patch) | |
| tree | e52c831396f869ddd01a010cea51d55c43ee6c93 | |
| parent | a8d3d1535cd100d62dcae43fbdb69bd726666976 (diff) | |
| parent | d5d35be3ed2bcd328f4c76000049e38d8ca5f82b (diff) | |
| download | mullvadvpn-95554b61f7752b963d03cd96088de8ce2b8d172b.tar.xz mullvadvpn-95554b61f7752b963d03cd96088de8ce2b8d172b.zip | |
Merge branch 'fix-in-app-notification-url-crash'
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/notification/NotificationWithUrl.kt | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 0171610550..902ce94cc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,6 +58,7 @@ Line wrap the file at 100 chars. Th - Fix quick settings tile being unresponsive and causing crashes on some devices. - Fix quick settings tile not working when the device is locked. It will now prompt the user to unlock the device before attempting to toggle the tunnel state. +- Fix crash when clicking in-app URL notifications. #### Windows - Only use the most recent list of apps to split when resuming from hibernation/sleep if applying diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/notification/NotificationWithUrl.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/notification/NotificationWithUrl.kt index 4257f8d2a6..8e03db6df5 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/notification/NotificationWithUrl.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/notification/NotificationWithUrl.kt @@ -2,6 +2,7 @@ package net.mullvad.mullvadvpn.ui.notification import android.content.Context import android.content.Intent +import android.content.Intent.FLAG_ACTIVITY_NEW_TASK import android.net.Uri abstract class NotificationWithUrl( @@ -11,7 +12,10 @@ abstract class NotificationWithUrl( private val url = Uri.parse(context.getString(urlId)) protected val openUrl: suspend () -> Unit = { - context.startActivity(Intent(Intent.ACTION_VIEW, url)) + val intent = Intent(Intent.ACTION_VIEW, url).apply { + flags = FLAG_ACTIVITY_NEW_TASK + } + context.startActivity(intent) } init { |
