Closed pawegio closed 8 years ago
After updating to 1.2.1 and replacing deprecated listener with new one, onDownloadComplete() is not called anymore, my code (kotlin syntax):
onDownloadComplete()
private fun downloadApk(context: Context, updateUrl: String, fileName: String, onProgress: (Int) -> Unit, onComplete: (Boolean) -> Unit) { val downloadUri = Uri.parse(updateUrl) val destinationUri = Uri.parse("${downloadDir.path}/$fileName") val downloadRequest = DownloadRequest(downloadUri) .setDestinationURI(destinationUri) .setDownloadContext(context) .setStatusListener(object : DownloadStatusListenerV1 { override fun onDownloadComplete(request: DownloadRequest?) { onComplete(true) } override fun onDownloadFailed(request: DownloadRequest?, errorCode: Int, errorMessage: String?) { onComplete(false) } override fun onProgress(request: DownloadRequest, totalBytes: Long, downloadedBytes: Long, progress: Int) { onProgress(progress) } }) ThinDownloadManager().add(downloadRequest) }
same issue
Fixed in version 1.2.2. Please use compile 'com.mani:ThinDownloadManager:1.2.2'
compile 'com.mani:ThinDownloadManager:1.2.2'
smanikandan14, Thanks so much its work!
now works fine, thanks!
After updating to 1.2.1 and replacing deprecated listener with new one,
onDownloadComplete()
is not called anymore, my code (kotlin syntax):