Doing something in background and then updating UI is very hard to implement correctly in Android. It's simply badly designed. Typical example is an AsyncTask that fetches something from the web and displays the result. There are 2 problems with this:
The AsyncTask has a reference to Activity (because it needs to update its UI). After screen orientation change, the Activity is restarted. But the AsyncTask still references to the old destroyed Activity therefore it can't update the UI of the new Activity.
This can lead to OutOfMemoryException. Imagine that you have an Activity with lots of bitmaps and start some AsyncTask. You press BACK (Activity is finished) but the AsyncTask is still running and because it references to the Activity, the Activity with bitmaps is still in memory. Repeat this (start Activity and BACK) and you have a force close sooner or later.
This can be solved, but it is way too complicated. In one Activity I have 3 different AsyncTasks, each of them can be running in several instances simultaneously. Implementing this correctly is frustrating. The code becomes really hard to understand and debug.
Can Honeycomb Loaders somehow solve this? And is there a way to use them in pre-Honeycomb Android versions?