The application I\'m working on is using a background thread to download a list of images through a API, then display the images in a slideshow.
There is a backgroun
Thanks to a helpful discussion with Waqas (thank you!) I finally uncovered the error in my code. In fact all above written is correct and works as is. Issue with my case was that the second task blocked the first one and vice versa.
It was perhaps a coincidence to find this post on Google Groups: http://groups.google.com/group/android-developers/browse_thread/thread/f0cd114c57ceefe3?tvc=2&q=AsyncTask+in+Android+4.0 . Recommend that everyone involved in threading reads this discussion carefully.
AsyncTask switched the Threading model to a serial executor (again), which is not compatible with my approach of having 2 AsyncTasks it seems.
Finally I switched the handling of the "Download" to a classic Thread
and used the Handler
to post messages to cancel the Slideshow if neccessary. Using the Handlers sendEmptyMessageDelayed
I will simple recreate the Download Thread after a while to refresh the data.
Thanks to all comments & answers.