it's like "use this fragment, but if you couldn't ...
# android
l
it's like "use this fragment, but if you couldn't find it, I cannot do anything so i'll just stop".
?:
is the elvis-operator, which says "take the nullable thing on the left if it's non-null, but use the right thing if it is null." in this case , as
return
is an expressing returning
Nothing
, you can use it in that place and return from your function if the left part is null. this is kinda confusing, if you don't understand the idea of the
Nothing
type and
throw
&
return
being expressions, so if your'e interested, i'd recommend looking up some kotlinConf talk about kotlins type hierarchy and the
Nothing
type. It's extremely practical once you understand it