Skip to content

Commit

Permalink
CATROID-1434 ANR: Move code acquiring a lock to IO thread
Browse files Browse the repository at this point in the history
  • Loading branch information
danielzhang130 committed Jul 17, 2023
1 parent 1597cf3 commit 34af7d7
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearSnapHelper
import androidx.recyclerview.widget.PagerSnapHelper
import com.google.android.material.snackbar.Snackbar
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import org.catrobat.catroid.ProjectManager
import org.catrobat.catroid.R
import org.catrobat.catroid.common.Constants
Expand Down Expand Up @@ -214,7 +217,9 @@ class MainMenuFragment : Fragment(),
DEFAULT_ROOT_DIRECTORY,
FileMetaDataExtractor.encodeSpecialCharsForFileSystem(currentProject)
)
loadProject(projectDir, requireContext())
CoroutineScope(Dispatchers.IO).launch {
loadProject(projectDir, requireContext())
}
loadProjectImage()
}

Expand Down

0 comments on commit 34af7d7

Please sign in to comment.