I have a user login screen. The user presses a login button and I create an IntentService to connect to my rest services and return back a authentication result.
Now here's the functionality I want to achieve: If the activity is paused (i.e. goes into the background) then the intent service should still run, and it does. But if I use the task manager to kill the application, the intent service should stop, although right now it doesn't. It continues executing onHandleIntent
until complete. If I manually call stopSelf()
, onDestroy()
is called but the onHandleIntent
method continues to execute. How do I force the onHandleIntent
to stop? Calling "return" is not an option because it could be caught up in one rest method call.
Should I be using intent service for this functionality or something else (like service or asynctask)?