Fixes Crash on Android API 16 (Jelly Bean)
Check that the version is greater than API 16 when calling Activity.isDestroyed()
This commit is contained in:
parent
4f36f3a600
commit
566e4ea2b3
2 changed files with 10 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
||||||
package com.simplemobiletools.gallery.adapters
|
package com.simplemobiletools.gallery.adapters
|
||||||
|
|
||||||
import android.graphics.PorterDuff
|
import android.graphics.PorterDuff
|
||||||
|
import android.os.Build
|
||||||
import android.support.v7.view.ActionMode
|
import android.support.v7.view.ActionMode
|
||||||
import android.support.v7.widget.RecyclerView
|
import android.support.v7.widget.RecyclerView
|
||||||
import android.util.SparseArray
|
import android.util.SparseArray
|
||||||
|
@ -430,7 +431,9 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList<Direc
|
||||||
}
|
}
|
||||||
|
|
||||||
fun stopLoad() {
|
fun stopLoad() {
|
||||||
if (!activity.isDestroyed)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && activity.isDestroyed)
|
||||||
|
return
|
||||||
|
|
||||||
Glide.with(activity).clear(view.dir_thumbnail)
|
Glide.with(activity).clear(view.dir_thumbnail)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.simplemobiletools.gallery.adapters
|
package com.simplemobiletools.gallery.adapters
|
||||||
|
|
||||||
import android.graphics.PorterDuff
|
import android.graphics.PorterDuff
|
||||||
|
import android.os.Build
|
||||||
import android.support.v7.view.ActionMode
|
import android.support.v7.view.ActionMode
|
||||||
import android.support.v7.widget.RecyclerView
|
import android.support.v7.widget.RecyclerView
|
||||||
import android.util.SparseArray
|
import android.util.SparseArray
|
||||||
|
@ -347,7 +348,9 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
|
||||||
}
|
}
|
||||||
|
|
||||||
fun stopLoad() {
|
fun stopLoad() {
|
||||||
if (!activity.isDestroyed)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && activity.isDestroyed)
|
||||||
|
return
|
||||||
|
|
||||||
Glide.with(activity).clear(view.medium_thumbnail)
|
Glide.with(activity).clear(view.medium_thumbnail)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue