public synchronized void dismiss() {
        if (isShowing()) {
            try {
                dialog.dismiss();
            } catch (final Exception e) {
                Log.e("Progress.dismiss", e);
            }
        }
        dialog = null;
    }
progress dialog wrapper for easier management of resources
main/src/main/java/cgeo/geocaching/activity/Progress.java