stop Bluetooth - Android Bluetooth

Android examples for Bluetooth:Turn off bluetooth

Description

stop Bluetooth

Demo Code


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

public class Main {
    public static void stopBluetooth() {
        BluetoothAdapter bluetoothAdapter = BluetoothAdapter
                .getDefaultAdapter();/*from   w w  w. j a  v a  2 s .c o  m*/
        if (bluetoothAdapter != null) {
            if (bluetoothAdapter.isEnabled()) {
                bluetoothAdapter.disable();
            }
        }
    }
}

Related Tutorials