diff --git a/download/src/main/java/me/twc/source/download/Downloader.kt b/download/src/main/java/me/twc/source/download/Downloader.kt index cd44169..d35163c 100644 --- a/download/src/main/java/me/twc/source/download/Downloader.kt +++ b/download/src/main/java/me/twc/source/download/Downloader.kt @@ -34,7 +34,9 @@ class Downloader( while (bytes >= 0) { fos.write(buffer, 0, bytes) downloadLength += bytes - callback.onDownload(downloadLength, totalLength) + withContext(Dispatchers.Main){ + callback.onDownload(downloadLength, totalLength) + } bytes = bs.read(buffer) } } catch (th: Throwable) {