AndroidRuntime(419): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dream/com.dream.activity.YunXingChengXuActivity}: android.util.AndroidRuntimeException: requestFeature() must be called before adding content
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tab_choice);
requestWindowFeature(Window.FEATURE_NO_TITLE);
}
其中: 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);
}