回答

0

您不能通過Fragment致電requestWindowFeature。要將內容設置爲Fragment,您需要覆蓋onCreateView()並返回您的Fragment應顯示的View

可能您應該閱讀更多關於Fragments

+0

嗯我動作條在片段中實現,是有顯示的動作條的ProgressBarIndeterminate的方法嗎? – jerrytouille 2013-03-26 10:46:52

+0

您可能需要進行一些更改,才能從您的「Fragment」中調用「Activity」。看看這個http://stackoverflow.com/questions/9058553/show-progress-spinner-refresh-on-actionbar – 2013-03-26 10:49:30

3
getActivity.setSupportProgressBarIndeterminateVisibility(true); 

getActivity().requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);