BluetoothAdmin states

mrossen

Active Member
Licensed User
Longtime User
Hi,

I trying to detect if the user enable/disable bluetooth

I use the BluetoothAdmin object, but it seems that I not understand it right?

B4X:
Dim BluetoothAdmin1 As BluetoothAdmin

Sub BluetoothAdmin1_StateChanged (NewState As Int, OldState As Int)

    Log(NewState)
    Log(OldState)

End Sub

Mogens
 

mrossen

Active Member
Licensed User
Longtime User
Hi,

I have read the doc.

It says :

StateChanged event is raised whenever the adapter state changes. The new state and the previous state are passed.
The values correspond to the STATE_xxxx constants.

As I understand that, is when the Bluetooth adapter changes its state the _StateChanged sub it fired? This can I not get to work!!

I have the StateChanged sub in a service running in the background, and would like to see when the bluetooth adapter is turned on/off.

Mogens
 
Upvote 0
Top