在单个活动屏幕上的我的应用程序中,我想请求以下两个窗口功能:
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
requestWindowFeature(Window.FEATURE_LEFT_ICON);
两者都在一次添加一个时工作,但是当我将它们加在一起时它们不起作用。
请建议我们如何在android中完成它?
修改 我的活动代码
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
Log.v("TAG", "After super.onCreate()");
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
Log.v("TAG", "after Window.FEATURE_INDETERMINATE_PROGRESS");
requestWindowFeature(Window.FEATURE_LEFT_ICON);
Log.v("TAG", "after Window.FEATURE_LEFT_ICON");
setContentView(R.layout.categotylist);
Log.v("TAG", "after setContentView");
lists = new ArrayList<String>();
\\some more code
}
logcat的
06-02 13:02:37.813: D/Prototype(421): ViewPagerActivityActivity : LOADING CATEGORY
06-02 13:02:38.092: D/dalvikvm(421): GC_FOR_MALLOC freed 7300 objects / 470264 bytes in 59ms
06-02 13:02:38.112: I/global(421): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
06-02 13:02:38.982: V/TAG(421): After super.onCreate()
06-02 13:02:38.982: V/TAG(421): after Window.FEATURE_INDETERMINATE_PROGRESS
06-02 13:02:38.992: V/TAG(421): after Window.FEATURE_LEFT_ICON
06-02 13:02:39.172: V/TAG(421): after setContentView
答案 0 :(得分:3)
您尝试制作requestWindowFeature() call before you call setContentView()?