The following is running on an Android 1.6 so I\'m using the compatibility package for fragments. In the following TestFragment
is a static nested class:
The documentation mentions that it can be null:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
[...]
container: If non-null, this is the parent view that the fragment's UI should be attached to. The fragment should not add the view itself, but this can be used to generate the LayoutParams of the view.
To be clear: you shouldn't do anything like container.addView(...)
.