Skip to content
This repository has been archived by the owner on Dec 31, 2019. It is now read-only.

java.lang.IllegalStateException: BT Adapter is not turned ON #23

Open
SamYangzx opened this issue Mar 15, 2016 · 1 comment
Open

java.lang.IllegalStateException: BT Adapter is not turned ON #23

SamYangzx opened this issue Mar 15, 2016 · 1 comment

Comments

@SamYangzx
Copy link

The log is:
java.lang.IllegalStateException: BT Adapter is not turned ON
at android.bluetooth.le.BluetoothLeUtils.checkAdapterStateOn(BluetoothLeUtils.java:136)
at android.bluetooth.le.BluetoothLeScanner.startScan(BluetoothLeScanner.java:107)
at android.bluetooth.le.BluetoothLeScanner.startScan(BluetoothLeScanner.java:102)
at android.bluetooth.BluetoothAdapter.startLeScan(BluetoothAdapter.java:1882)
at android.bluetooth.BluetoothAdapter.startLeScan(BluetoothAdapter.java:1799)
at com.orbotix.le.c.run(SourceFile:26)
at java.lang.Thread.run(Thread.java:818)

When my app fail to connect Ollie, I will reset the bluetooth first. I think it is the problem.But whether there is no protect in the code?

@rigortek
Copy link

you should check BluetoothAdapter state is STATE_ON before you star or stop scan BLE

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

No branches or pull requests

2 participants