From f8a4e68a1f7b7cb0a62f7d5654368b50bf0828f2 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 22 Mar 2018 15:16:09 +0100 Subject: [PATCH] add an extra activity existing check at trying to reload bitmap --- .../com/simplemobiletools/gallery/fragments/PhotoFragment.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt index 85c4212ef..8f830f336 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/PhotoFragment.kt @@ -258,7 +258,9 @@ class PhotoFragment : ViewPagerFragment() { if (!useHalfResolution && e?.rootCauses?.firstOrNull() is OutOfMemoryError) { useHalfResolution = true Handler().post { - loadBitmap(degrees) + if (activity?.isActivityDestroyed() == false) { + loadBitmap(degrees) + } } } return false