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

java.lang.IllegalStateException: The current store is com.liulishuo.okdownload.core.breakpoint.BreakpointStoreOnSQLite@11ffbcb not RemitStoreOnSQLite! #500

Open
vincent911001 opened this issue May 23, 2023 · 1 comment

Comments

@vincent911001
Copy link

OkDownload Version

v1.0.7

Problem Describe

使用RemitStoreOnSQLite.setRemitToDBDelayMillis(10)会导致错误

java.lang.IllegalStateException: The current store is com.liulishuo.okdownload.core.breakpoint.BreakpointStoreOnSQLite@11ffbcb not RemitStoreOnSQLite!
at com.liulishuo.okdownload.core.breakpoint.RemitStoreOnSQLite.setRemitToDBDelayMillis(RemitStoreOnSQLite.java:171)
@randoll01
Copy link

randoll01 commented Dec 10, 2024

在调用RemitStoreOnSQLite.setRemitToDBDelayMillis方法之前初始化OkDownload,并设置downloadStore为RemitStoreOnSQLite;如在application的onCreate方法中进行初始化OkDownload:
val downloadStore = OkDownload.Builder(context).downloadStore(BreakpointStoreOnSQLite(context).createRemitSelf()).build()
OkDownload.setSingletonInstance(downloadStore)
RemitStoreOnSQLite.setRemitToDBDelayMillis(10)

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

2 participants