From 02acd5cc845557d4bdb7f5bce24654329cd78389 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 2 Sep 2017 23:02:35 +0200 Subject: [PATCH] properly get the OutputStream at SD cards too --- .../filemanager/adapters/ItemsAdapter.kt | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt index 8a063322..8b642fb3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt @@ -27,10 +27,7 @@ import com.simplemobiletools.filemanager.dialogs.CompressAsDialog import com.simplemobiletools.filemanager.extensions.config import com.simplemobiletools.filemanager.extensions.isZipFile import kotlinx.android.synthetic.main.list_item.view.* -import java.io.Closeable -import java.io.File -import java.io.FileInputStream -import java.io.FileOutputStream +import java.io.* import java.util.* import java.util.zip.ZipEntry import java.util.zip.ZipFile @@ -285,7 +282,7 @@ class ItemsAdapter(val activity: SimpleActivity, var mItems: MutableList, targetPath: String): Boolean { val queue = LinkedList() - val out = FileOutputStream(File(targetPath)) + val out = getFileOutputStream(targetPath) val zout = ZipOutputStream(out) var res: Closeable = out @@ -333,6 +330,23 @@ class ItemsAdapter(val activity: SimpleActivity, var mItems: MutableList