If I have a property `var activity : Activity?` in...
# announcements
d
If I have a property
var activity : Activity?
in my class. Why do I need to add the !! if I want to use the activity? Should't the compiler know that it is not null if I check before? It certainly works if I call the method on the instance. But if I have the instance as a parameter to a method than I have to add !!.
Copy code
if (activity != null)        directoryPickerModel.save(activity!!)
I know activity is not null now. But why does the compiler not know?