I'm starting an Activity
with an Intent
. This Intent
contains a Serializable
Object which is then sent to a server in the onCreate
method in order to get the response to display.
I'd like to be able to do the following: When i close the Activity
the task doing the web request should be destroyed, in case it hasn't finished yet.
I'm using a synchronous Web Request Library (Spring). So AsyncTask
's cancel wouldn't help since i cannot afford to loop. Is there a way to destroy an AsyncTask instantaneously?