In an existing Android project I\'ve encountered the following piece of code (where I inserted the debugging litter)
ImageView img = null;
public void onCre
I had the same problem, and using view.getHandler() also failed because the handler was not present. runOnUiThread() solved the problem. Presumably this does actually do some queueing until the UI is ready.
The cause for me was calling the icon load task in a base class and the result being returned so quickly that the main class hadnt estabished the view (getView() in fragment).
I'm a bit suspicious that it might spuriously fail sometime. But I'm now ready for it! Thanks guys.