We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3934

Summary: turning bluetooth keyboard on or off crashes the app
Product: SDL Reporter: trabitboy
Component: eventsAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2 CC: sylvain.becker
Version: 2.0.7   
Hardware: ARM   
OS: Android (All)   

Description trabitboy 2017-11-01 20:28:06 UTC
on an SDL2.0.5 app,
powering on or powering off bluetooth keyboard crashes the app.
Seen also on love2D where it restarts the app
Comment 1 trabitboy 2017-12-12 11:55:44 UTC
Tested again on SDL 2.0.7 , android 6 ; arm eabi v7a

The app doesn't crash anymore but freezes ( on sync and desync ).
If the keyboard is already synchronized; app starts fine and functions normally
( until desync )
Comment 2 Sylvain 2017-12-13 09:28:13 UTC
can you do an "adb logcat" and provides the crash/exception stack trace.
Comment 3 trabitboy 2017-12-14 16:12:41 UTC
not a bug , at least on 2.0.5, the keyboard on off on android is a configuration change and restarts the activity :

https://stackoverflow.com/questions/25735227/bluetooth-keyboard-will-cause-activity-destroy-and-recreate

solution tested works,
maybe changing the default manifest to include the fix would be good.
Comment 4 Sylvain 2017-12-14 17:57:20 UTC
Moreover it's already in the lastest source:
https://hg.libsdl.org/SDL/diff/7274ada44290/android-project/app/src/main/AndroidManifest.xml