I am working on three different services and on device bootup, one service starts other two services. Right now its working fine but some times my service crashes and it restarts itself. I know that this behaviour is common with services, if the memory is low then for reclaiming the memory service restarts itself.
I need to track the service info like getting the service crash time. Right now I retrieve the service start time by writing code in onstartCommand()
and stop time in onDestroy()
.
What I observe is stop time in onDestroy()
code does not execute when service is crashed. So Is there a way to get the service crash time?