public synchronized void setMaxProgressAndReset(final int max) {
        if (isShowing()) {
            dialog.setMax(max);
            dialog.setProgress(0);
        }
        progress = 0;
    }
progress dialog wrapper for easier management of resources
main/src/main/java/cgeo/geocaching/activity/Progress.java