public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {}
container实际上添加fragment时,包裹fragment的view
例如:若使用下面的方式添加fragment,那么container就是R.id.activity_layout对应的RelativeLayout这个view
FragmentManager mFragmentManager = getFragmentManager();
FragmentTransaction mFragmentTransaction = mFragmentManager.beginTransaction();
mFragmentTransaction.replace(R.id.activity_layout ,fragment, tag);
mFragmentTransaction.addToBackStack(tag);
mFragmentTransaction.commit();
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:id="@+id/activity_layout"
android:layout_height="match_parent" >
</RelativeLayout>