private void cancelProgress(final Progress progress) {
        if (progress != null && progress.isShowing()) {
            progress.dismiss();
        }
    }
Feature to surround execution of a worker task visually with a progress dialog
main/src/main/java/cgeo/geocaching/utils/workertask/ProgressDialogFeature.java