code: protected void hideProgressDialog() {
  		// do nothing if the dialog is already being displayed
  		synchronized ( lockProgress ) {
  			if( progressDialog == null )
  				return;
  		}
  
  		if (Looper.getMainLooper().getThread() == Thread.currentThread()) {
  			// if inside the UI thread just dismiss the dialog and avoid a potential locking condition
  			synchronized ( lockProgress ) {
  				progressDialog.dismiss();
  				progressDialog = null;
  			}
  		} else {
  			runOnUiThread(new Runnable() {
  				public void run() {
  					synchronized ( lockProgress ) {
  						progressDialog.dismiss();
  						progressDialog = null;
  					}
  				}});
  
  			// block until dialog has been dismissed
  			while( progressDialog != null  ) {
  				Thread.yield();
  			}
  		}
  	}
docs: Dismisses the progress dialog.  Can be called even if there is no progressDialog being shown.