Skip to content

Commit

Permalink
Add exclude recents flag to avoid showing multiple open activities in…
Browse files Browse the repository at this point in the history
… recents (#2805)

Add exclude recents flag to avoid showing multiple open activities
  • Loading branch information
dshokouhi committed Aug 20, 2022
1 parent da8263d commit efdd527
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1587,6 +1587,7 @@ class MessagingManager @Inject constructor(
intent.putExtra("fragment", NOTIFICATION_HISTORY)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS)

return PendingIntent.getActivity(
context,
Expand Down Expand Up @@ -1886,6 +1887,7 @@ class MessagingManager @Inject constructor(
else
WebViewActivity.newInstance(context, title)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS)
context.startActivity(intent)
} catch (e: Exception) {
Log.e(TAG, "Unable to open webview", e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class ManageShortcutsViewModel @Inject constructor(
)
intent.action = shortcutPath
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS)
intent.putExtra("iconId", iconId)

val shortcut = ShortcutInfo.Builder(getApplication(), shortcutId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ class WebsocketManager(
val intent = WebViewActivity.newInstance(applicationContext)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS)
val pendingIntent = PendingIntent.getActivity(
applicationContext,
0,
Expand All @@ -201,6 +202,7 @@ class WebsocketManager(
settingIntent.putExtra("fragment", "websocket")
settingIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
settingIntent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
settingIntent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS)
val settingPendingIntent = PendingIntent.getActivity(
applicationContext,
0,
Expand Down

0 comments on commit efdd527

Please sign in to comment.