Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何在杀了应用后,可以断点续传下载 #499

Open
vincent911001 opened this issue May 12, 2023 · 0 comments
Open

如何在杀了应用后,可以断点续传下载 #499

vincent911001 opened this issue May 12, 2023 · 0 comments

Comments

@vincent911001
Copy link

OkDownload Version

v1.0.7

Problem Describe

            task = DownloadTask.Builder(url, File(path))
                .setFilename(filename)
                .setMinIntervalMillisCallbackProcess(200)
                .setPassIfAlreadyCompleted(false)
                .build()

重启应用后,怎么能重新初始化一个能断点续传的DownloadTask

DownloadTask
this.id = OkDownload.with().breakpointStore().findOrCreateId(this);

如果重新初始化了,在BreakPointStore会找不到id,然后就不能续传了, 请问我理解对吗?

DownloadCall

            BreakpointInfo info;
            try {
                BreakpointInfo infoOnStore = this.store.get(this.task.getId());
                if (infoOnStore == null) {
                    info = this.store.createAndInsert(this.task);
                } else {
                    info = infoOnStore;
                }

                this.setInfoToTask(info);

有其他方案吗?感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant