Guest User

Untitled

a guest
Aug 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. How to check if bluetooth is enabled programmatically?
  2. BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
  3. if (mBluetoothAdapter == null) {
  4. // Device does not support Bluetooth
  5. } else {
  6. if (!mBluetoothAdapter.isEnabled()) {
  7. // Bluetooth is not enable :)
  8. }
  9. }
  10.  
  11. <uses-permission android:name="android.permission.BLUETOOTH" />
Add Comment
Please, Sign In to add comment