Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.
This repository was archived by the owner on May 1, 2024. It is now read-only.

Unpreventable Acitivity re-creation on physical keyboard connection change #15720

Closed
@EORG-Dev

Description

@EORG-Dev

Hi everyone,

whenever I plug in a physical keyboard (USB/Samsung-POGO/Bluetooth) my applications activity is re-created. This behaviour is expected and there is a known fix for it: Adding ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden to the MainActivity as per the following SO Post: https://stackoverflow.com/questions/18444476/android-crashes-on-keyboard-plugging

Expected behaviour: The Activity is not recreated an there is no interuption of the users interaction with the app.
Actual behaviour: The Activity is recreated

To recreate this issue: I recommend to create a blank project. Launch the MainPage as NavigationPage and add a Button to it. Then create a new empty page and navigate to it. This makes the recreation very visible as after the re-creation the navigation root is shown. This also represents the situation in my app very closely.

So far I did a lot of research on this, although I have no native android development experience. There also seems to be a surprising amount of other, commercial Apps that also crash on this configchange.

Thanks in advance, feel free to ask for more info

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions