0
我在应用程序中有一个本地服务,它在asynctask中执行一些网络操作。android本地服务问题
在我的应用程序有两个活动,活动A和B.活动
我服务的生命周期和活动,是这样的。
In activity A:
1)stop service(in oncreate)
In activity B:
1)start service(in oncreate)
2)bindservice(in oncreate)
3)unbind service(in on destroy)
In service:
1)start download in async task(in oncreate)
2)stop async task(in ondestroy)
但是服务仍在running.is有什么iam失踪? 感谢
FIX:
i need to stop the async task before i call stopService. As the service is busy with asyn task, it will ignore my my stop requests.
1)send a msg to service in intent extra, to stop async task.
2)then call stop service
我不想停止活动B中的服务,我想阻止它在一个如果用户再次--thx启动应用程序 –
在这种情况下,您需要解除活动A中的服务。 –
我发现该缺陷,请参阅更新后的帖子。非常感谢你的帮助。 –