Skip to content

A fold, rotation or resize stops a running job and resets the app state #187

Closed

Description

@zeevy

GrblActivity.onDestroy() runs on every activity destroy, including a recreate after a configuration change. It does:

stopService(new Intent(this, FileStreamerIntentService.class));
ConsoleLoggerListener.resetClass();
FileSenderListener.resetClass();
MachineStatusListener.resetClass();

The activities are locked to portrait and marked not resizable, but Android 16 ignores both on large screens (smallest width 600dp and up) for apps that target SDK 36. So on a tablet or a foldable, opening the fold, rotating or resizing the window recreates the activity, and that:

  • stops a running job in the middle (the service is stopped),
  • forgets the selected G-code file, the console log and the machine state.

Expected: a recreate keeps the job running and keeps the state. Only a real exit (isFinishing()) should stop the service and reset the state.

Found while fixing the streaming start crash (ForegroundServiceDidNotStartInTimeException).

Activity

  1. zeevy commented on Oct 10, 2026

    @zeevy
    OwnerAuthor

    Fixed in PR #192 (branch fix/187-188-lifecycle-state). Reproduced on the emulator with the old code and checked the fix there and on a Pixel 6a with GRBL 1.1f over USB. Closes when the PR is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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