SETUP One Activity, SingleTop, receives an intent from a notification. Intent is consumed by activity. User hits back button to end the activity. onDestory gets called and isFinishing() returns true. Long press Home key to bring up recent apps. Launch previously closed application.
Similar situation occurs with onNewIntent when onStop is called after user presses home key on activity.
Problem Upon recreation of the activity after it's finished, the same intent from the notification is used. I don't want this. Is there a way to tell the system that we already consumed that notification so stop giving it to the activity? Work around? Suggestions?
What I have Tried
- I tried to remove extras from the intent. Not working. Clearning Activity's intent data randomly comes back, why?
- I tried to saveInstanceState() to keep a time stamp on intents. However onIstanceState(Bundle) is removed (null in onCreate) when activity is destroyed.
- I tried to set intent to null in activity but that does not work
This question is very similar to this one: http://grokbase.com/t/gg/android-developers/119jyzf492/getintent-removeextra-in-activity-doesnt-work-for-android-launchmode-“singletask”