I’m using an IntentService to upload images to a server. My problem is that I don’t know how/when to stop the service. When I call stopself() in onHandleIntent(Intent ..) all Intents which are waiting in the IntentService queue are removed. But I don’t want to stop the service from an activity because I want to complete upload proccess even if my application is not running.
Share
IntentServiceautomatically stops itself whenonHandleIntent()ends, if no more commands had been sent to it whileonHandleIntent()was running. Hence, you do not manually stop anIntentServiceyourself.Which is why you do not do that.
Then you let the
IntentServicestop itself.