Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android app Activity restarts on Bluetooth connection/disconnection events #156

Open
CitizenOneX opened this issue Aug 24, 2024 · 0 comments

Comments

@CitizenOneX
Copy link
Contributor

The Android system restarts the current Activity when it detects certain "configChanges", unless the app declares in its AndroidManifest.xml that the app will specifically handle (including ignore) the change.

Bluetooth disconnection (and connection) events are such a config change, and somewhat astonishingly have the configChanges label of "nagivation", which is not included in the noa-flutter android:configChanges list. Unless this Activity restart is intended behaviour, "|navigation" should probably be appended to the list.

There is some rationale for such a disruptive change based on a bluetooth event (e.g. connecting/disconnecting a bluetooth keyboard) - it might result in a full redraw of the app to include/remove an on-screen keyboard etc.

In my case I was testing control using a bluetooth page-turning ring in my own app, and I was able to reproduce the issue in noa-flutter.

Given general difficulty with pairing, connecting and disconnecting, I'm sure it doesn't help if the app (which has to connect as its first step!) also restarts its activity on every connect and disconnect event (unless you're really good at persisting the state, restoring it, and re-establishing connections etc.)

@siliconwitch siliconwitch added this to Noa Aug 28, 2024
@siliconwitch siliconwitch moved this to Todo in Noa Aug 28, 2024
@siliconwitch siliconwitch moved this from Todo to Backlog / Future / Reference in Noa Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog / Future / Reference
Development

No branches or pull requests

1 participant