I start my app through a PendingIntent that comes from a notification and looks likes this:
PendingIntent pendingIntent = PendingIntent.getActivity
(getApplicationContext(), 1 , intent, PendingIntent.FLAG_ONE_SHOT);
I set an extra so that a specific task is performed and get it via:
GcmListenerService.PushNotificationTrigger pushNotificationTrigger = (GcmListenerService.PushNotificationTrigger) intent.getSerializableExtra(
GcmListenerService.GCM_PUSH_TRIGGER_KEY);
After the task is performed, I "close" the app via back press (simple onBackPressed). When opening the app again, it performs the task again. I debugged it and came to the result, that the pushNotificationTrigger is still the same. The Intent had the same extras as before I closed it. It seems to me, like Android caches it.
What I already tried and what didn't worked:
Removing the extra, after it was read the first time with:
intent.removeExtra(GcmListenerService.GCM_PUSH_TRIGGER_KEY);
Overriding onBackPressed with finish()
Is there a solution for this?