Java 如何在片段内调用requestWindowFeature
我想打电话:Java 如何在片段内调用requestWindowFeature,java,android,android-fragments,android-actionbar,request,Java,Android,Android Fragments,Android Actionbar,Request,我想打电话: requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); 但下面的代码不起作用: @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_INDETERMINA
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
但下面的代码不起作用:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
View rootView = inflater.inflate(R.layout.fragment_login, container, false);
return rootView;
}//end onCreateView
有人能帮忙吗。谢谢在
片段中尝试这个
getActivity().requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
在Fragment
getActivity().requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
在碎片中,它不起作用。错误-在添加内容片段之前必须调用requestFeature(),因为它不起作用。错误-添加内容之前必须调用requestFeature()