mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-06-05 22:09:15 +02:00
check if the activity is alive when getting items
This commit is contained in:
@ -162,6 +162,10 @@ class ItemsFragment : Fragment(), ItemsAdapter.ItemOperationsListener, Breadcrum
|
|||||||
|
|
||||||
private fun getItems(path: String, callback: (items: ArrayList<FileDirItem>) -> Unit) {
|
private fun getItems(path: String, callback: (items: ArrayList<FileDirItem>) -> Unit) {
|
||||||
Thread {
|
Thread {
|
||||||
|
if (activity?.isActivityDestroyed() == true) {
|
||||||
|
return@Thread
|
||||||
|
}
|
||||||
|
|
||||||
if (!context!!.config.enableRootAccess || !context!!.isPathOnRoot(path)) {
|
if (!context!!.config.enableRootAccess || !context!!.isPathOnRoot(path)) {
|
||||||
getRegularItemsOf(path, callback)
|
getRegularItemsOf(path, callback)
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user