I want to send an event to the server whenever my application is terminated, either manually or by OS. Is there any way that I can detect the application termination. Currently I am depending on activity lifecycle's onStop() to detect it. But as onStop() is called even when an activity goes into background, I cannot differentiate between whether app is paused or it is terminated.
Kindly, help. Thanks in advance.