I want to perform some activities like clearing cache, singletons clearing etc. I will write all this code in Service which will be background but I need this service to be triggered only when application is closed or exited.
I cant put my code to statrt service in onDestroy of activity as whenever i will move between my activities it will call onDestroy of previous activity.
How to know if application is exited.
Example will really help.
Thanks.