Skip to content

Commit

Permalink
fix: Click notification won't jump to the main activity
Browse files Browse the repository at this point in the history
  • Loading branch information
kaaass committed Sep 17, 2023
1 parent 6da7927 commit ed08042
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -985,15 +985,15 @@ private boolean updateTunnelConfig(Network network) {
this.notificationManager.createNotificationChannel(channel);
}
int pendingIntentFlag = PendingIntent.FLAG_UPDATE_CURRENT;
if (Build.VERSION.SDK_INT >= 23) {
pendingIntentFlag |= PendingIntent.FLAG_ONE_SHOT;
}
if (Build.VERSION.SDK_INT >= 31) {
pendingIntentFlag |= PendingIntent.FLAG_IMMUTABLE;
}
var pendingIntent =
PendingIntent.getActivity(this, 0,
new Intent(this, NetworkListActivity.class), pendingIntentFlag);
new Intent(this, NetworkListActivity.class)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP
| Intent.FLAG_ACTIVITY_CLEAR_TOP)
, pendingIntentFlag);
var notification = new NotificationCompat.Builder(this, Constants.CHANNEL_ID)
.setPriority(1)
.setOngoing(true)
Expand Down

0 comments on commit ed08042

Please sign in to comment.