private void showBackupCompletedStatusDialog(final Folder backupDir, final boolean trackfilesResult, final boolean settingsResult, final Boolean databaseResult, final boolean autobackup) {
        String msg;
        final String title;
        if (trackfilesResult && settingsResult && databaseResult) {
            if (autobackup) {
                return; // We don't need to inform the user if everything went right
            }
            title = activityContext.getString(R.string.init_backup_finished);
            msg = activityContext.getString(R.string.backup_saved) + "\n" + backupDir.toUserDisplayableString();
        } else {
            title = activityContext.getString(R.string.init_backup_backup_failed);

            if (databaseResult != null) {
                msg = activityContext.getString(R.string.init_backup_success) + "\n" + backupDir.toUserDisplayableString() + "/" + DataStore.DB_FILE_NAME_BACKUP;
            } else {
                msg = activityContext.getString(R.string.init_backup_failed);
            }

            msg += "\n\n";

            if (settingsResult) {
                msg += activityContext.getString(R.string.settings_saved) + "\n" + backupDir.toUserDisplayableString() + "/" + SETTINGS_FILENAME;
            } else {
                msg += activityContext.getString(R.string.settings_savingerror);
            }

            if (!trackfilesResult) {
                msg += "\n\n" + activityContext.getString(R.string.backup_tracks_error);
            }
        }

        final ArrayList<Uri> files = new ArrayList<>();

        for (ContentStorage.FileInformation fi : ContentStorage.get().list(backupDir)) {
            files.add(fi.uri);
        }

        if (autobackup) {
            ActivityMixin.showToast(activityContext, msg);
        } else {
            SimpleDialog.of(activityContext).setTitle(TextParam.text(title)).setMessage(TextParam.text(msg))
                .setNeutralButton(TextParam.id(R.string.cache_share_field))
                .setNeutralAction(() -> ShareUtils.shareMultipleFiles(activityContext, files, R.string.init_backup_backup))
                .show();
        }
    }
Private methods containing the real backup process
main/src/main/java/cgeo/geocaching/utils/BackupUtils.java