Skip to content

Instantly share code, notes, and snippets.

@navczydev
Last active October 22, 2021 01:59
Show Gist options
  • Save navczydev/f9a0ee16de0bcce275a1600b4b3b48b6 to your computer and use it in GitHub Desktop.
Save navczydev/f9a0ee16de0bcce275a1600b4b3b48b6 to your computer and use it in GitHub Desktop.
class NotificationReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
// from Android12 this will not work
// Indirect notification activity start (trampoline) from PACKAGE_NAME, \ this should be
//avoided for performance reasons.
context.startActivity(Intent(context, NotificationTrampolineActivity::class.java).apply {
flags = Intent.FLAG_ACTIVITY_NEW_TASK
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment