Created
March 9, 2018 13:30
-
-
Save dario61081/e50f98db33689dae5015651c7c3e0136 to your computer and use it in GitHub Desktop.
bluetoothAdapterUtils
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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