在添加内容Android Fragment之前必须调用requestFeature()

时间:2015-04-10 19:22:21

标签: java android android-layout android-fragments android-activity

无法让这个工作,为什么我得到“requestFeature()必须在添加内容之前调用”?

这是片段。

 @Override
    public View onCreateView(final LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {


        getActivity().requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);

        final View rootView = inflater.inflate(R.layout.expand, container, false);
        getActivity().setContentView(R.layout.expand);

        getActivity().getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.window_title);



        ExpandList = (ExpandableListView) rootView.findViewById(R.id.exp_list);

        PD = new ProgressDialog(getActivity());
        PD.setMessage("Loading.....");
        PD.setCancelable(false);

        makejsonobjreq();

        return rootView;
    }

0 个答案:

没有答案