I'm new to android and trying to programmatically connect a BluetoothDevice. Device has a PIN. Connecting to device is in another thread than UI. So far I have followed example from How to programmatically pair a bluetooth device on Android.
On BluetoothDevice.ACTION_PAIRING_REQUEST I convert String to byte[] and do a setPin call. the pairing dialog pops out and dissapear. Any actions like
Method createBondMethod1 = device.getClass().getMethod("cancelPairingUserInput"); Boolean returnValue2 = (Boolean) createBondMethod1.invoke(device);
have failed on setPin. BluetoothDevice.ACTION_PAIRING_REQUEST is triggered when device.createBond() is called.
The question is how can I hide Pairing dialog?
Thanks.