首先建立四个fragment_tem分别继承fragment,如下: public class HalfyearFragment extends Fragment { public Context mContext=getActivity(); @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View myview =inflater.inflat...