1. Fragment中给Adapter初始化数据context一定要在onAttach()方法之后,比如onCreateView()中。不能在成员变量中通过getActivity()获取Context,比如:
SampleAdapter adapter = new SampleAdapter(getActivity(), datas);