android - force-closing an app with a service: onDestroy() is not called in service? -


i've implemented sticky service , when force close app see activity's ondestroy() called. service doesn't apparently anything.


here's logcat:

07-01 22:35:30.397: debug/activitymine(6505): ondestroy()  07-01 22:35:32.667: info/activitymanager(71): force stopping package my.large.package uid=10036  07-01 22:35:32.667: warn/activitymanager(71): scheduling restart of crashed service my.large.package/.service.servicecommunicator in 5000ms  07-01 22:35:32.667: info/process(71): sending signal. pid: 6505 sig: 9  07-01 22:35:32.687: info/activitymanager(71):   force stopping service servicerecord{451f65b8 my.large.package/.service.servicecommunicator} 

as can see, servicecommunicator() doesn't call: stopservice(), finalize(), or ondestroy() ! i've put log calls in 3 of them.

how know when service force closed? need trap event can close files.

how know when service force closed?

you don't. ondestroy() not guaranteed called, on component.

i need trap event can close files.

then don't leave them open.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -