When I want to create a simple fragment, usually use following code:
public class TestFragment extends Fragment {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_latout, container, false);
}
}
My questions are:
What exactly is container parameter? where it is defined?
Can we see this ViewGroup(container) in XML/Layout Designer?
In this method(onCreateView), what is this ViewGroup(container) id?
In R.id.x
, to access this ViewGroup(container) What should we replace x with?
Thanks.