Private static void removePairDevice () {
BluetoothAdapter mBluetoothAdapter=BluetoothAdapter. GetDefaultAdapter ();
If (mBluetoothAdapter getState ()==BluetoothAdapter. STATE_OFF) {
MBluetoothAdapter. The enable ();
Try {
Thread.sleep (3000);
{} catch InterruptedException (e)
e.printStackTrace();
}
}
If (mBluetoothAdapter!=null) {
Set
For (BluetoothDevice device: bondedDevices) {
UnpairDevice (device);
}
}
}
Private static void unpairDevice (BluetoothDevice device) {
Try {
Method m=device getClass (). GetMethod (" removeBond ", (Class []) null);
M.i nvoke (device, (Object []) null);//remove fails, return false.
} the catch (Exception e) {
The e (TAG, um participant etMessage ());
}
}
Are there any other way?