Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to unpair bluetooth device using android 2.1 sdk

In Android 2.1, to unpair a Bluetooth device you can go to Bluetooth settings, long-click on a device and select Unpair to unpair that device. I want to be able to do this from my application. I can retrieve a list of paired/bonded devices using BluetoothAdapter.getBondedDevices(), but I can't find how to unpair. I've explored the BluetoothChat sample, and I've searched the sdk but still can't find an API that allows this.

How can I unpair a Bluetooth device?

like image 593
user417738 Avatar asked Aug 11 '10 21:08

user417738


1 Answers

you can send the user to bluetooth setting, by this you can unpair devices which are paired Intent intentOpenBluetoothSettings = new Intent(); intentOpenBluetoothSettings.setAction(android.provider.Settings.ACTION_BLUETOOTH_SETTINGS); startActivity(intentOpenBluetoothSettings);`

like image 174
Mohd Qasim Avatar answered Sep 21 '22 19:09

Mohd Qasim