title: How to exit all the Async task on cancellation of activity?
body: <p>According to the post below:
  <a href="http://techtej.blogspot.com.es/2011/03/android-thread-constructspart-4.html" rel="nofollow">http://techtej.blogspot.com.es/2011/03/android-thread-constructspart-4.html</a>. It says that:</p>
  
  <blockquote>
    <p>In such cases, where your application is not shutdown, but any foreground tasks have been closed or changed, all the background tasks need to know of this and try to exit gracefully</p>
  </blockquote>
  
  <p>To achieve this, I am calling the <code>cancel</code> function on all the <code>AsyncTask</code> instances. Is this the right way? Also sometimes in image lazy loading, I don't keep track of all the <code>AsyncTask</code>s alive (and fetching images), so how to say the <code>Android OS</code> to cancel them too?</p>