kill - Execute method when Android app process is finished -
i'm working on android app , need know when os killed process, can make http request server. i've tried start service , put request in ondestroy() method, service stops when kill manualy (with start_sticky). use start_not_sticky, service ends app, not execute ondestroy() method.
my manifest looks this:
<service android:name=".checksessionendservice" android:enabled="true" android:exported="false" > </service>
when process killed it's gone. can't execute anymore. ondestroy() called after service stopped, either stopservice() or stopself() (and service isn't bound), not mean process has been killed. if you're concerned user swiping app recents try
or
http://developer.android.com/reference/android/content/pm/serviceinfo.html#flag_stop_with_task
Comments
Post a Comment