I am facing a problem that it seems I cannot find the correct solution.
My app starts with Activity A which is a loading screen that generates a singleton class that is used throughout the whole app.
Then it goes to activity B. A gets finished() so the stack only has Activity B.
At that point Activity B creates and sends a notification based on some data from the web. So far so good. The notification shows nicely.
Here's where the problem starts:
The notification has an EXPLICIT intent to Activity C. If the app is running and the user decides to check his notification then Activity C is displayed. However, if the user does something else, like press HOME and start opening some other apps, the OS kills my process to save memory etc. The notification IS STILL there. Since the intent is EXPLICIT if the user clicks on it after the app has died or killed by the OS, the result is crash since important data that was generated by Activity A is now null!
I have tried to handle this by using an IMPLICIT intent and specifying an intent-filter. However, I am not sure which activity A or B should handle the intent filter. Activity A preloads mandatory data for the app to work. If I handle this intent with activity A the user thinks he just restarted his app.
Remember, Activity C started by the notification cannot "live" without the mandatory data from both Activity A and B is generated.
I really need your help and input on this.