Skip to content

Fix notification for app exit on Android 12#28

Merged
thomasbuilds merged 1 commit into
mainfrom
notification-close-action
Jul 23, 2026
Merged

Fix notification for app exit on Android 12#28
thomasbuilds merged 1 commit into
mainfrom
notification-close-action

Conversation

@thomasbuilds

Copy link
Copy Markdown
Owner

The foreground-service notification can't be swiped away before Android 13, so the "Swipe to close app" hint was a dead end on Android 12/12L with no other way to exit the app. Show a Stop measuring action there instead, and keep the hint only where swiping works. Post updates through startForeground rather than notify(): notify() strips the foreground-service flag from the record, letting the notification outlive the service on non-swipe stop paths.

Fixes #27

The foreground-service notification can't be swiped away before
Android 13, so the "Swipe to close app" hint was a dead end on
Android 12/12L with no other way to exit the app. Show a Stop
measuring action there instead, and keep the hint only where swiping
works. Post updates through startForeground rather than notify():
notify() strips the foreground-service flag from the record, letting
the notification outlive the service on non-swipe stop paths.
@github-actions

Copy link
Copy Markdown

Download the debug APK for commit 07845c8

@thomasbuilds
thomasbuilds merged commit 621bf2d into main Jul 23, 2026
5 checks passed
@thomasbuilds
thomasbuilds deleted the notification-close-action branch July 23, 2026 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No way to exit the app on Android 12

1 participant