android BluetoothDevice.getName() return null
问题 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 remoteDeviceName. BluetoothAdapter.getDefaultAdapter().startLeScan(new LeScanCallback() { @Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { String remoteDeviceName = device.getName(); Log.d("Scanning", "scan device " + remoteDeviceName); }); 回答1: Finally, i found out the