@Override
public void bleDataReceiverObserver(BluetoothDevice bluetoothDevice) {
Log.v("bleDataReceiverObserver", bluetoothDevice.getName());
if (list.size() == 0)
list.add(new BleData(bluetoothDevice, bluetoothDevice.getAddress(), bluetoothDevice.getName()));
for (BleData bleData : list) {
if (bleData.getAddress().equals(bluetoothDevice.getAddress())) {
break;
} else
list.add(new BleData(bluetoothDevice, bluetoothDevice.getAddress(), bluetoothDevice.getName()));
}
}
Bluetooth scan results are received directly through the receiver. However, the speed of coming in and saving to the list is so fast that exceptions are made. What should I do?