Skip to content

[BUG] App Crashes on Rotation, Window Resize or Losing Focus #65

@armoha

Description

@armoha

Describe the bug
App crashes during decompressing when screen rotates, app window is resized, or app is losing focus.

To Reproduce
Steps to reproduce the behaviour:

  1. Decompress large ZIP file (400 MB for me)
  2. While it decompresses, rotate screen, resize app window, or let app lose focus.
  3. App crashes with the log, and app will be at its main menu.
java.lang.IllegalStateException: Fragment ExtractFragment{494053d} (ca2e77f3-f849-41f0-b6a4-f1b9cdce5ac2) not attached to an activity.
	at androidx.fragment.app.Fragment.requireActivity(Fragment.java:947)
	at com.wirelessalien.zipxtract.ExtractFragment$zip4jExtractZipFile$1.invokeSuspend(ExtractFragment.kt:426)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
	Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@609ecc4, Dispatchers.IO]

Expected behaviour
Keep unzip on background or pause/resume unzip.

Smartphone (please complete the following information):

  • Device: Samsung Galaxy S23
  • Version: Android 15

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions