How do you solve the issue with the `@Nullable` an...
# android
k
How do you solve the issue with the
@Nullable
annotation on the
getActivity()
and
getContext()
in the android SDK 27 changes ? Personally I’m not keen to spread the nullable context all around the app.
g
Depends on case.
requreActivity()
can be used as easiest solution, equivalent to
getActivity()!!
, but in many cases you actually can check for null activity and do not crash and just do nothing
a
I, for one, welcome our new non-platform-type overloads