I know that this is a very simple error but I can't quite comprehend the nuances of kotlin enough to solve it just yet.
I'm getting the error:
Type mismatch: inferred type is BluetoothDevice? but BluetoothDevice was expected
When trying to pass a BluetoothDevice
in as parcelable
class ScanDevice(var device: BluetoothDevice, var rssi: Int): Parcelable {
...
constructor(parcel: Parcel) : this(
parcel.readParcelable(BluetoothDevice::class.java.classLoader), <--- here
parcel.readInt()
)
...
It's technically just a warning and not actually an error but I'm not sure what is happening here.