save the images on a background thread

This commit is contained in:
tibbi 2017-04-24 22:56:24 +02:00
parent 972916f6b2
commit 4786fc7c54

View file

@ -232,6 +232,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
private fun saveImageAs() {
val currPath = getCurrentPath()
SaveAsDialog(this, currPath) {
Thread({
val selectedFile = File(it)
val tmpFile = File(selectedFile.parent, "tmp_${it.getFilenameFromPath()}")
try {
@ -253,6 +254,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
toast(R.string.unknown_error_occurred)
deleteFile(tmpFile) {}
}
}).start()
}
}