We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
// 创建任务 val downloadTask = lifecycleScope.download(downloadURL, "base.apk", this.filesDir.toString()) downloadTask.state() .onEach { state -> Log.i("Download APK", "Downloaded Progress: ${state.progress.percent()}") loadingDialog.progress = state.progress.percent().toInt() if (state is State.Succeed) { loadingDialog.dismiss() loadingDialog.progress = 0 Toast.makeText(this, "Download done!", Toast.LENGTH_LONG).show() installApk(this, ProgressDialog(this), "this.filesDir.toString()/base.apk") } } .launchIn(lifecycleScope) // 使用lifecycleScope downloadTask.start() 当本地已存在文件时下载会回调多次
// 创建任务 val downloadTask = lifecycleScope.download(downloadURL, "base.apk", this.filesDir.toString()) downloadTask.state() .onEach { state -> Log.i("Download APK", "Downloaded Progress: ${state.progress.percent()}") loadingDialog.progress = state.progress.percent().toInt() if (state is State.Succeed) { loadingDialog.dismiss() loadingDialog.progress = 0 Toast.makeText(this, "Download done!", Toast.LENGTH_LONG).show() installApk(this, ProgressDialog(this), "this.filesDir.toString()/base.apk") } } .launchIn(lifecycleScope) // 使用lifecycleScope downloadTask.start()
The text was updated successfully, but these errors were encountered:
谢谢反馈,我会尽快修复,你可以暂时先使用标记变量控制一下
Sorry, something went wrong.
No branches or pull requests
// 创建任务 val downloadTask = lifecycleScope.download(downloadURL, "base.apk", this.filesDir.toString()) downloadTask.state() .onEach { state -> Log.i("Download APK", "Downloaded Progress: ${state.progress.percent()}") loadingDialog.progress = state.progress.percent().toInt() if (state is State.Succeed) { loadingDialog.dismiss() loadingDialog.progress = 0 Toast.makeText(this, "Download done!", Toast.LENGTH_LONG).show() installApk(this, ProgressDialog(this), "this.filesDir.toString()/base.apk") } } .launchIn(lifecycleScope) // 使用lifecycleScope downloadTask.start()
当本地已存在文件时下载会回调多次
The text was updated successfully, but these errors were encountered: