Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
为某些工作创建子线程的绑定服务。当我从活动中调用最后一个客户端的 unbindService 时,服务中的子线程将如何表现?
谢谢。
其他。Service本身将处于销毁状态,因此进程更有可能被系统杀死。Threads他们自己将继续做他们的工作,但如果他们是匿名或内部类,他们将保留对你的引用Service(从而造成内存泄漏)。您不能保证Threads在进程被终止之前完成。
Service
Threads