i have a local service in application, which does some network operation in the asynctask.
In my application there are two activities activity A and activity B.
the life cycle of my service is and activities is like this.
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)
But the service is keep on running.is there something iam missing? Thanks
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