File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
base/src/main/java/com/windscribe/vpn/backend/utils Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import android.app.NotificationChannel
10
10
import android.app.NotificationManager
11
11
import android.app.PendingIntent
12
12
import android.content.Intent
13
+ import android.os.Build
13
14
import android.os.Build.VERSION
14
15
import android.os.Build.VERSION_CODES
15
16
import androidx.annotation.RequiresApi
@@ -130,12 +131,16 @@ class WindNotificationBuilder @Inject constructor(
130
131
notificationBuilder.addAction(action)
131
132
// Launch App on Notification click.
132
133
val contentIntent = Windscribe .appContext.applicationInterface.splashIntent
133
- contentIntent.flags = Intent .FLAG_ACTIVITY_NEW_TASK or Intent .FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
134
- val pendingIntent = PendingIntent
135
- .getActivity(
136
- Windscribe .appContext, 0 , contentIntent,
137
- if (VERSION .SDK_INT >= VERSION_CODES .M ) PendingIntent .FLAG_IMMUTABLE else 0
138
- )
134
+ contentIntent.flags = Intent .FLAG_ACTIVITY_CLEAR_TOP or Intent .FLAG_ACTIVITY_SINGLE_TOP
135
+ val pendingIntent = PendingIntent .getActivity(
136
+ Windscribe .appContext,
137
+ 0 ,
138
+ contentIntent,
139
+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .M )
140
+ PendingIntent .FLAG_IMMUTABLE or PendingIntent .FLAG_UPDATE_CURRENT
141
+ else
142
+ PendingIntent .FLAG_UPDATE_CURRENT
143
+ )
139
144
notificationBuilder.setContentIntent(pendingIntent)
140
145
}
141
146
You can’t perform that action at this time.
0 commit comments