Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BluetoothMedic Crashes without Looper #980

Closed
davidgyoung opened this issue Jun 10, 2020 · 0 comments · Fixed by #981
Closed

BluetoothMedic Crashes without Looper #980

davidgyoung opened this issue Jun 10, 2020 · 0 comments · Fixed by #981

Comments

@davidgyoung
Copy link
Member

davidgyoung commented Jun 10, 2020

Expected behavior

No crash instantiating BluetoothMedic

Actual behavior

If you construct BluetoothMedic.getInstance(...) on a thread that does not have a looper, the call will crash with:

java.lang.RuntimeException: Can't create handler inside thread Thread[AsyncTask #4,5,main] that has not called Looper.prepare()

The call will succed on both the UI thread and a background thread so but only if the background thread has a looper.

The easiest workaround is to run this on a UI thread

Steps to reproduce this behavior

  1. Create a new thread without a looper
  2. Call the method above

Mobile device model and OS version

Pixel 3a

Android Beacon Library version

2.17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant