Snippet to show how to wait, then execute code on the UI thread. The example shown is part of an Activity.