Every App crashes, if you connect a BT input-device I have a problem with my Android-tablets and a connected Bluetooth remote control. (It gets detected as a BT-keyboard, which is fine to me)

The remote control is a BT 4.0-remote control and is already paired with Android. Once it is connected, it is working fine.

The problem is the connection process itself: When the remote control is not connected - e.g. after some idle time, or after a reboot of the system - you press a button and it immediately reconnects. This part is working good. 

However while it is connecting, the current foreground activitiy crashes! This affects every app, no matter what. 

E.g. if I am in the launcher, the screen goes black for a split-second until it redraws everything. If I am in a game-app (for testing), the game completely restarts. While it wouldn't be a problem if it goes black for just a split second, it is a major problem in my own app, that I am currently developing:
The app completely restarts. The user sees nothing for 3 seconds (that's the time the app needs to load).

First I thought it was a programming issue on my side, that's why I posted a question on Stack Overflow

But now I found out, that it is not a programming problem, because every app crashes and restarts, once you reconnect the BT-device. What can I do to fix this?

Devices, where I tested the BT Remote:


Android 4.4.2 tablet ("no-name" product) - The error is present
Android 5.1 tablet ("no-name" product) - The error is present
Android 5.1.1 phone (Samsung xCover) - No problem!!
Android 4.4.2 phone (Samsung GALAXY S III Neo) - No problem!!


I hope somebody has an idea how to fix this.
I'm seeing the same behavior between my Samsung Galaxy A tablet and a Zagg Flex Bluetooth keyboard. When it connects or disconnects, the current app reinitializes itself or force-closes. In order of misbehavior, I see apps do one of three things (with one example each): force-close (Lightning Launcher), reinitialize and lose any work-in-progress (ES File Explorer), or gracefully handle the connection event as if nothing happened (Chrome). Performing a search on Google, it seems that this is "by design:" Android will reinitialize an app when the BT keyboard connection status changes, but apps can declare to Android that the app will handle the event itself and therefore avoid the reload.