如何在Fragment中调用requestWindowFeature

时间:2014-10-28 09:38:32

标签: 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_INDETERMINATE_PROGRESS);
    View rootView = inflater.inflate(R.layout.fragment_login, container, false);

     return rootView;
    }//end onCreateView
是的,有人可以伸出援助之手。感谢

1 个答案:

答案 0 :(得分:3)

Fragment

中试试
getActivity().requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);