android-bluetooth-serial
android-bluetooth-serial copied to clipboard
BluetoothManager.getInstance() never null
It;s probably because I am new to Android / Kotlin.
Trying to make a use of that module, So far working fine with list and bluetooth enabled. I have part of code that checks the instance as in readme:
private var bluetoothManager: BluetoothManager? =BluetoothManager.getInstance()
override fun onCreate(savedInstanceState: Bundle?) {
if (bluetoothManager == null) {}
}
But Android studio gives me a hint, that bluetoothManager is never null
That's strange, in the Kotlin rewrite it looks like this:
https://github.com/harry1453/android-bluetooth-serial/blob/a2075b9444dae1ed6b934d23da78262d48bfb994/androidBluetoothSerial/src/main/java/com/harrysoft/androidbluetoothserial/BluetoothManager.kt#L78
And is quite clearly nullable.