Fenikkel
Fenikkel

Reputation: 101

Check if bluetooth is active on Android?

Is there a programmatically way to check if Bluetooth is active on an Android device?

To know if the Location is enabled it's like this:

if (!Input.location.isEnabledByUser)
{
    //Location not active!
    return;
}

Upvotes: 1

Views: 207

Answers (1)

rootKitty
rootKitty

Reputation: 101

I guess you can just check the adapter state :

public void EnableIfNeeded(BluetoothAdapter adapter)
 {
     if (!adapter.IsEnabled)
     {
         adapter.Enable();
     }
 }

Upvotes: 2

Related Questions