0
我有一部android手機和條碼掃描器。要使用掃描儀,我將它與手機配對,但在我的應用程序中,我希望有一點斷開掃描儀,所以要做到這一點,我認爲一個不成功就足夠了。我嘗試從here 接受的答案,但它不起作用。也許BluetoothDevice對象不正確?Android如何取消配對藍牙掃描器
String mac = BluetoothAdapter.getDefaultAdapter().getAddress();
BluetoothDevice bluetoothDevice = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(mac);
其實我一直不明白該怎麼把地址getRemoteDevice()方法,所以我把手機藍牙MAC地址。我應該在那裏放置其他地址嗎?我將不勝感激任何答案。
預先感謝您
您應該使用遠程設備的地址,而不是您自己的地址。 – TJD