disable Bluetooth - Android Bluetooth

Android examples for Bluetooth:Turn off bluetooth

Description

disable Bluetooth

Demo Code


//package com.java2s;
import android.bluetooth.BluetoothAdapter;

public class Main {
    public static void disableBluetooth() {
        BluetoothAdapter bluetoothAdapter = BluetoothAdapter
                .getDefaultAdapter();//ww  w. ja v a 2s .c om
        if (bluetoothAdapter != null && bluetoothAdapter.isEnabled()) {
            bluetoothAdapter.disable();
        }
    }
}

Related Tutorials