开发者

Stopping a service once it has finished it's work

I have an Android Service that is started by my application and does some things in a threadPool using开发者_Python百科 Executors.newCachedThreadPool()

Once it has finished doing it's work I would like the service to stopSelf(), how can I get the service to determine when it is no longer needed (ie, there are no more Threads executing) so that it can shut itself down automatically?


Do it the other way: the last Runnable should shut the Service upon completion.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜