Quantcast
Channel: Active questions tagged return-value - Stack Overflow
Viewing all articles
Browse latest Browse all 207

Android Bluetooth - createBond return value

$
0
0

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,


Viewing all articles
Browse latest Browse all 207

Trending Articles