I have some code in my Application class that needs to be run whenever the app is launched. However my app also has some service running and because of that, whenever the service is invoked the code in my Application class also runs.
I want to identify if my app process was started because user launched the app via his app drawer OR if the process was started because my app's service was invoked.
PS: I want some part of my Application class code to be run ONLY when the user opens his app by clicking on the icon and NOT when some service is started. Note that I don't want to make this distinction in my MainActivity, I want to identify this in my Application class itself
Any tips / resources would be very helpful here.
Thanks!