catch FileNotFoundException at returning GetImageContent intent result

This commit is contained in:
tibbi 2017-06-15 21:39:19 +02:00
parent 5d2528b415
commit 9452d96e75

View file

@ -27,10 +27,7 @@ import com.simplemobiletools.gallery.helpers.*
import com.simplemobiletools.gallery.models.Directory import com.simplemobiletools.gallery.models.Directory
import com.simplemobiletools.gallery.views.MyScalableRecyclerView import com.simplemobiletools.gallery.views.MyScalableRecyclerView
import kotlinx.android.synthetic.main.activity_main.* import kotlinx.android.synthetic.main.activity_main.*
import java.io.File import java.io.*
import java.io.FileInputStream
import java.io.InputStream
import java.io.OutputStream
import java.util.* import java.util.*
class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
@ -302,6 +299,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
inputStream = FileInputStream(File(path)) inputStream = FileInputStream(File(path))
outputStream = contentResolver.openOutputStream(output) outputStream = contentResolver.openOutputStream(output)
inputStream.copyTo(outputStream) inputStream.copyTo(outputStream)
} catch (ignored: FileNotFoundException) {
} finally { } finally {
inputStream?.close() inputStream?.close()
outputStream?.close() outputStream?.close()