Skip to content

Instantly share code, notes, and snippets.

@gbzarelli
Last active September 24, 2018 14:12
Show Gist options
  • Save gbzarelli/16c34c1a153d915442214b469aef4bfe to your computer and use it in GitHub Desktop.
Save gbzarelli/16c34c1a153d915442214b469aef4bfe to your computer and use it in GitHub Desktop.
Intent.FLAG_ACTIVITY_CLEAR_TOP on Notification
val intent = Intent(ChatActivity.ACTION_VIEW)
intent.putExtra(ChatActivity.PARAM_OBJECT, group)
intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
val pendingIntent = PendingIntent
.getActivity(context, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT)
// Activities: A(Main), B e C - O codigo acima gera uma nova activity B na mesma task, excluindo a B, C anterior.
// Manifest: Main activity: android:launchMode="singleTask"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment