stop Bluetooth - Android android.bluetooth

Android examples for android.bluetooth:Bluetooth On Off

Description

stop Bluetooth

Demo Code

import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.util.Log;
import java.lang.reflect.Method;
import java.util.Set;

public class Main{

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

}

Related Tutorials