check if the activity is alive when getting items

This commit is contained in:
tibbi
2017-12-06 21:18:12 +01:00
parent 50ca0ae838
commit 58ded92b34

View File

@ -162,6 +162,10 @@ class ItemsFragment : Fragment(), ItemsAdapter.ItemOperationsListener, Breadcrum
private fun getItems(path: String, callback: (items: ArrayList<FileDirItem>) -> Unit) {
Thread {
if (activity?.isActivityDestroyed() == true) {
return@Thread
}
if (!context!!.config.enableRootAccess || !context!!.isPathOnRoot(path)) {
getRegularItemsOf(path, callback)
} else {