Skip to content

Instantly share code, notes, and snippets.

@dario61081
Created March 9, 2018 13:30
Show Gist options
  • Select an option

  • Save dario61081/e50f98db33689dae5015651c7c3e0136 to your computer and use it in GitHub Desktop.

Select an option

Save dario61081/e50f98db33689dae5015651c7c3e0136 to your computer and use it in GitHub Desktop.
bluetoothAdapterUtils
public static void activarBluetooth(boolean value) {
BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (value) {
if (!bluetoothAdapter.isEnabled()) {
bluetoothAdapter.enable();
}
}else{
if (bluetoothAdapter.isEnabled()){
bluetoothAdapter.disable();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment