So, I seen answers to this question in Stackoverflow, but I don't found final answer. So, I've following a problem: I've separated Thread to Socket. And I create and start this thread on Application onCreate method. And I need intercept this thread when application killed from recent apps list. If user press back button system will call to onDestroy, and this situation I can intercept socket thread. But, I can't intercept socket thread when user kill app from recent apps list.
Anybody have final answer how to solve this problem?