Fixed bug 4566 - Hot-plugging Bluetooth controller causes force-quit on Android
authorSam Lantinga <slouken@libsdl.org>
Wed, 24 Apr 2019 12:53:15 -0700
changeset 12720f926c8070a2a
parent 12719 b9da55e54f98
child 12723 24883e864f7e
Fixed bug 4566 - Hot-plugging Bluetooth controller causes force-quit on Android

Anthony @ POW Games

I tried adding different configChanges and sure enough, "navigation" worked! Now bluetooth controllers hot-plug nicely. So shall we add it as a default to the AndroidManifest.xml?

Funny that this is how this activity is described:

"navigation" The navigation type (trackball/dpad) has changed. (This should never normally happen.)

I think the reason behind this is because the bluetooth game controller I was testing doubles-up as a keyboard, which probably comes with a DPAD? It's a MOCUTE-032X_B63-88CE
android-project/app/src/main/AndroidManifest.xml
     1.1 --- a/android-project/app/src/main/AndroidManifest.xml	Tue Apr 23 16:57:34 2019 -0700
     1.2 +++ b/android-project/app/src/main/AndroidManifest.xml	Wed Apr 24 12:53:15 2019 -0700
     1.3 @@ -56,7 +56,7 @@
     1.4              android:label="@string/app_name"
     1.5              android:alwaysRetainTaskState="true"
     1.6              android:launchMode="singleInstance"
     1.7 -            android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
     1.8 +            android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
     1.9              >
    1.10              <intent-filter>
    1.11                  <action android:name="android.intent.action.MAIN" />