requestfeature专题

PreferenceActivity里自定义标题栏(title bar)出错:requestFeature() must be called before adding content

一般activity里自定义标题栏时候,我们一般会遵循一个顺序: 1   final boolean isCustom = requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);2 setContentView(R.layout.you_layout);3 if(isCustom){4 getWindow().set

解决:requestFeature() must be called before adding content

开发中出现这样的错误:requestFeature() must be called before adding content 首先:这句话的大概意思是说,requestFeature()这个方法要放到内容前面。 举个例子:    this.setContentView(R.layout.layout_update);   this.requestWindowFeature(Window