pull/1649/head
kunfei 3 years ago
parent 32aad5aecd
commit 8712a58ed4
  1. 7
      app/src/main/java/io/legado/app/service/DownloadService.kt

@ -83,6 +83,7 @@ class DownloadService : BaseService() {
toastOnUi("已在下载列表")
return
}
kotlin.runCatching {
// 指定下载地址
val request = DownloadManager.Request(Uri.parse(url))
// 设置通知
@ -96,6 +97,12 @@ class DownloadService : BaseService() {
if (upStateJob == null) {
checkDownloadState()
}
}.onFailure {
when (it) {
is SecurityException -> toastOnUi("下载出错,没有存储权限")
else -> toastOnUi("下载出错,${it.localizedMessage}")
}
}
}
@Synchronized

Loading…
Cancel
Save