I’m creating Bluetooth custom application, but I have a small issue. When in my receiver I detect a device, I want to store this device in Set<BluetoothDevice>.
But my receiver is a different class, and when I write this code:
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
ClassName.SetVar.add(device);
Then it is showing an exception. I want to store all detecting device in a variable and want to use in diffrent thread to establish a connection.
Finally i solved by using a constructor