private void restoreDatabaseInternal(final Folder backupDir, final Consumer<String> consumer) {
        final ContentStorage.FileInformation dbFile = getDatabaseFile(backupDir);

        final ProgressDialog dialog = ProgressDialog.show(activityContext, activityContext.getString(R.string.init_backup_restore), activityContext.getString(R.string.init_restore_running), true, false);
        final StringBuilder stringBuilder = new StringBuilder();
        AndroidRxUtils.andThenOnUi(Schedulers.io(), () -> stringBuilder.append(DataStore.restoreDatabaseInternal(activityContext, dbFile.uri)), () -> {
            dialog.dismiss();
            consumer.accept(stringBuilder.toString());
        });
        if (activityContext instanceof MainActivity) {
            ((MainActivity) activityContext).updateCacheCounter();
        }
    }
Private methods containing the real backup process
main/src/main/java/cgeo/geocaching/utils/BackupUtils.java