Android GLSurfaceView不工作

Android GLSurfaceView不工作,android,glsurfaceview,Android,Glsurfaceview,我编写了一个简单的代码来测试GLSurfaceView package com.jeobin.test; import android.app.Activity; import android.os.Bundle; import android.opengl.GLSurfaceView; public class MainActivity extends Activity { GLSurfaceView view; @Override protected void

我编写了一个简单的代码来测试GLSurfaceView

package com.jeobin.test;

import android.app.Activity;
import android.os.Bundle;
import android.opengl.GLSurfaceView;

public class MainActivity extends Activity {
    GLSurfaceView view; 
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        view = new GLSurfaceView(this);
        setContentView(view);
    }
}
当我在代码中添加setContentView(视图)时,它会崩溃。这是我的舱单

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.jeobin.test"
    android:versionCode="1"
    android:versionName="1.0" >
    <uses-feature android:glEsVersion="0x00020000" android:required="true" />
    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="19" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>


eclipse有什么问题吗?

你说的“故障”是什么意思?它能跑吗?为了使用OpenGL ES,您必须编写一个renderer类,并使用setRenderer()将其设置为GLSURFACHEVIEW。查看此信息:

当我在note3中打开此应用程序时,它显示“不幸的是,测试失败”。在这里,我只是做了一个测试代码来测试GLSurface是否可以工作。在我的另一段代码中,我确实编写了renderer.class。我认为问题在于,在调用setContentView之前,需要将renderer设置为GLSurfaceView类。