mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-15 10:26:53 -04:00
#2361 removed writeText and added copyTo method in saveHandler class
This commit is contained in:
parent
e98d873eae
commit
adad1f12f6
@ -174,8 +174,9 @@ open class KiwixWebView @SuppressLint("SetJavaScriptEnabled") constructor(
|
|||||||
}
|
}
|
||||||
val source = Uri.parse(src)
|
val source = Uri.parse(src)
|
||||||
try {
|
try {
|
||||||
val input = zimReaderContainer.load("$source").data
|
zimReaderContainer.load("$source").data.use {
|
||||||
storageDir.writeText(input.readBytes().toString())
|
it.copyTo(storageDir.outputStream())
|
||||||
|
}
|
||||||
val toastText = instance.getString(R.string.save_media_saved, newUrl)
|
val toastText = instance.getString(R.string.save_media_saved, newUrl)
|
||||||
instance.toast(toastText)
|
instance.toast(toastText)
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user