title: Android Bluetooth - createBond return value
body: <p>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-</p>
  
  <pre><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();
  </code></pre>
  
  <p>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 ?</p>
  
  <p>Thanks in advance,</p>