di3mex
11/15/2015, 3:54 PMvar 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 !!.
if (activity != null) directoryPickerModel.save(activity!!)
I know activity is not null now. But why does the compiler not know?