android BluetoothDevice.getName() return null

前端 未结 7 599
没有蜡笔的小新
没有蜡笔的小新 2020-11-28 11:37

On sometime, BluetoothDevice.getName() return null. How can i fix it? remoteDeviceName maybe null in following code. And i need distinguish my device and other devices by re

7条回答
  •  时光取名叫无心
    2020-11-28 12:04

    BluetoothDevice.getName() may return null if the name could not be determined. This could be due to any number of factors. Regardless, the name is the friendly name of the device, and shouldn't be used to distinguish it from other devices. Instead, use the hardware address through getAddress().

提交回复
热议问题