I am working on a Bluetooth application. It consists, among other things, of a list view displaying the paired and visible devices. Long clicking on the unpaired ones opens up the pairing dialog which I have implemented using this code-
Class class1 = Class.forName("android.bluetooth.BluetoothDevice"); Method createBondMethod = class1.getMethod("createBond"); int position = ((AdapterContextMenuInfo)item.getMenuInfo()).position;boolean result = ((Boolean)createBondMethod.invoke(pairedDevices.get(position).getDevice())).booleanValue();
I have observed that this method returns immediately without waiting for the pairing to complete. But I need to know whether the pairing succeeded or not. Is this indicated in the function's return value or is there some other way of knowing it ?
Thanks in advance,