79458250

Date: 2025-02-21 17:57:58
Score: 1.5
Natty:
Report link

Use a BroadcastReceiver Instead of PendingIntent.getActivity()

Instead of launching the activity directly, let's use a broadcast receiver to handle the notification click. This way, the extras are delivered properly even if the app gets terminated.

Create a BroadcastReceiver to Handle Notification Clicks

First up, define a BroadcastReceiver that'll catch the notification click and start the Activity with the needed extras

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: Mamad AriaKia