Skip to content

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

@CitizenOneX

Description

@CitizenOneX

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog / Future / Reference

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions