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