If I have a nullable Boolean b, I can do the following comparison in Java:
Boolean b = ...;
if (b != null && b) {
/* Do something */
From what I've seen the Boolean? is a result of a method that returns Boolean on an object that is nullable
val person: Person? = null
....
if(person?.isHome()) { //This won't compile because the result is Boolean?
//Do something
}
The solution I've been using is to use the let function to remove the possible returned null value like so
person?.let {
if(it.isHome()) {
//Do something
}
}