In my code, I'm trying to unpair a bluetooth device by calling the function.
import android.bluetooth.BluetoothDevice; .....
BluetoothDevice Device = mBluetoothAdapter.getRemoteDevice(address); .......
public void unpair() { int state = getBondState();
if (state == BluetoothDevice.BOND_BONDING || state == BluetoothDevice.BOND_BONDED) {
Device.cancelBondProcess(); //Error in this line
}