0

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.

3
  • 2
    Maybe the issue are the "no-name" devices. Can you check with more devices? It's also possible that the remote control uses some edge case commands that are not handled correctly.
    – GiantTree
    Jun 3, 2016 at 10:38
  • Thank you for your comment. I have checked with one more device (LG Android 4.4) where it it working, too. I also think, the problem might be the very very cheap "no-name" devices. But I have no idea how to fix this...
    – Michael B
    Jun 6, 2016 at 6:18
  • Interested developers looking to prevent this from happening can look at the answer for Android crashes on keyboard plugging.
    – ueen
    Jul 7, 2020 at 5:32

1 Answer 1

1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .