In the following Android lifecycle method:
@Override
public View onCreateView(
LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = super.onCreateView(inflater, container, savedInstanceState);
...
return view;
}
onCreateView takes in a LayoutInflater
, @Nullable Viewgroup
, and a @Nullable Bundle
.
The issue I have is in the sample program I am referring to: sceneform-android-sdk
There doesn't seem to be an instance where we call the method onCreateView
and pass in a LayoutInflatter, Viewgroup, and Bundle. And yet, we are able to use the passed in parameters.
Yes we call super.onCreateView(...)
, but again, where did the values passed as arguments to the super, that were the parameters of our local
version of onCreateView, come from?
My main question, reiterated, would be what is it that calls the onCreateView method and passes in the parameters?
My second question is, if I were to create a method in the same activity onCreateView is in:
public void foo(LayoutInflater myInflater) // Or it takes in a Bundle, Viewgroup, etc.
Would my foo method also get the same parameter values as the onCreateView method?
Lastly, my third question would be in a similar vein. A view is returned, but like before, it doesn't look like we handle the return. So, what handles the return value??
If possible, I would humbly request further reading regarding how Android core code works so as to implement my own methods that properly make use of
parameters from Android and how to properly return values to Android as well.