requestWindowFeature(Window.FEATURE_NO_TITLE); 导致应用程序崩溃?

Let*_*rIt 2 android android-framelayout

添加此行时,应用程序崩溃

`requestWindowFeature(Window.FEATURE_NO_TITLE);

可能解决方案很简单,但我真的不知道该修复它的人.

Java代码:

public class GLSurfaceCameraSurfaceDemo2Activity extends Activity {
/** Called when the activity is first created. */

GLSurfaceView glSurfaceView;
FrameLayout fl01;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    requestWindowFeature(Window.FEATURE_NO_TITLE);

}
Run Code Online (Sandbox Code Playgroud)

}

XML文件:

<FrameLayout 
        android:id="@+id/fl01" 
        android:orientation="horizontal" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent"/>  
Run Code Online (Sandbox Code Playgroud)

Fra*_*nco 13

你必须调用requestWindowFeature(Window.FEATURE_NO_TITLE); 在setContentView()之前......

public class GLSurfaceCameraSurfaceDemo2Activity extends Activity {
/** Called when the activity is first created. */

GLSurfaceView glSurfaceView;
FrameLayout fl01;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.main);

}
Run Code Online (Sandbox Code Playgroud)