This example shows you how to properly use a thread to do work while displaying an indeterminate ProgressDialog.