requestFeature() must be called before adding cont
原创
©著作权归作者所有:来自51CTO博客作者generallizhong的原创作品,请联系作者获取转载授权,否则将追究法律责任
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tab_choice);
requestWindowFeature(Window.FEATURE_NO_TITLE);
}
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tab_choice);
requestWindowFeature(Window.FEATURE_NO_TITLE);
}
02-17 10:31:38.792: E/AndroidRuntime(630): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.hr/com.hr.tab_choice}: android.util.AndroidRuntimeException: requestFeature() must be called before adding content
其中:
setContentView(R.layout.tab_choice);
requestWindowFeature(Window.FEATURE_NO_TITLE);
两行顺序换一下就可以了。
改后:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.tab_choice);
}
其中:
setContentView(R.layout.tab_choice);
requestWindowFeature(Window.FEATURE_NO_TITLE);
两行顺序换一下就可以了。
改后:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.tab_choice);
}