the getView method this : "Get the root view for the fragment's layout (the one provided by onCreateView), if provided.
Returns: The fragment's root view, or null if it has no layout"
My question is : why doesn't getView() return null when you only have one fragment tag(and nothing else) in an activity layout ? Since there is no root view such as <LinearLayout><LinearLayout/> that contains the fragment tag.
Thanks in advance !
getView() returns view you provided in onCreateView(). Therefore, if onCreateView() doesn't return null, getView() will not return null
Обсуждают сегодня