mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2024-12-27 00:34:31 +01:00
handle whole bitmap saving in edit activity on a background thread
This commit is contained in:
parent
f63a8eebac
commit
88d8f39118
@ -184,18 +184,17 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
||||
}
|
||||
|
||||
private fun saveBitmapToFile(bitmap: Bitmap, path: String) {
|
||||
val file = File(path)
|
||||
|
||||
try {
|
||||
getFileOutputStream(file) {
|
||||
if (it != null) {
|
||||
Thread {
|
||||
Thread {
|
||||
val file = File(path)
|
||||
getFileOutputStream(file) {
|
||||
if (it != null) {
|
||||
saveBitmap(file, bitmap, it)
|
||||
}.start()
|
||||
} else {
|
||||
toast(R.string.image_editing_failed)
|
||||
} else {
|
||||
toast(R.string.image_editing_failed)
|
||||
}
|
||||
}
|
||||
}
|
||||
}.start()
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
} catch (e: OutOfMemoryError) {
|
||||
|
Loading…
Reference in New Issue
Block a user