From 813f45dc05f3e25723b711a63d467c482ae162bb Mon Sep 17 00:00:00 2001 From: gedoor Date: Mon, 27 Sep 2021 12:19:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/service/DownloadService.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/service/DownloadService.kt b/app/src/main/java/io/legado/app/service/DownloadService.kt index 773cc0f84..e1fb58efb 100644 --- a/app/src/main/java/io/legado/app/service/DownloadService.kt +++ b/app/src/main/java/io/legado/app/service/DownloadService.kt @@ -115,10 +115,11 @@ class DownloadService : BaseService() { private fun successDownload(downloadId: Long) { if (!completeDownloads.contains(downloadId)) { completeDownloads.add(downloadId) - if (downloads[downloadId]?.second?.endsWith(".apk") == true) { + val fileName = downloads[downloadId]?.second + if (fileName?.endsWith(".apk") == true) { installApk(downloadId) } else { - toastOnUi("${downloads[downloadId]?.second} ${getString(R.string.download_success)}") + toastOnUi("$fileName ${getString(R.string.download_success)}") } } }