android - Life cycle of the application: How to do some clean jobs when the process is terminated? -
my application straightforward, main activity -> activity 1 -> activity 2, , there worker thread doing downloading jobs. , started within same process.
i want downloading thread not terminated until activities destroyed, or @ end of process. in java, simple: ok adding clean code in main method. don't know right way in android. because every activity possible recycled system, don't know put clean code of worker thread, , dont't know end point of total application.
could give me ideas? thanks.
not sure if helps, can start service in main activity , have clean code in service's ondestroy method. service destroyed when application destroyed
onterminate works on emulator - stated in docs.
Comments
Post a Comment