when someone closes my application by swiping it off, i would like to send a message to a server (in this case, another phone that is working as a hotspot).
The problem is that i can't figure out what method gets called when someone does that. I tried onDestroy()
, but it doesn't always get called, only works sometimes, i guess it deppends on the memory resources, etc.
I need to inform the server when a client leaves.
Does any of you know how i could do this?
PS: My minimum api is 9, so i could use the onTaskRemoved()
for API > 14, but what about the others?