Android에서 새로운 기능으로 프로그래밍 방식으로 BluetoothDevice에 연결하려고합니다. 기기에 PIN이 있습니다. 장치에 연결하는 것이 UI가 아닌 다른 스레드에 있습니다. 지금까지 나는 How to programmatically pair a bluetooth device on Android에서 예를 따라 왔습니다.Android : 페어링 대화 상자 숨기기
켜기 BluetoothDevice.ACTION_PAIRING_REQUEST 문자열을 byte []로 변환하고 setPin 호출을 수행합니다. 페어링 대화 상자가 튀어 나와 사라집니다.
Method createBondMethod1 = device.getClass().getMethod("cancelPairingUserInput"); Boolean returnValue2 = (Boolean) createBondMethod1.invoke(device);
같은 조치는 setPin에 실패했다. device.createBond()가 호출되면 BluetoothDevice.ACTION_PAIRING_REQUEST이 트리거됩니다.
질문은 어떻게 페어링 대화 상자를 숨길 수 있습니까?
감사합니다.