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)}") } } }