Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 从TableLayoutView活动切换到GLSurfaceView活动时出现问题_Android_Opengl Es - Fatal编程技术网

Android 从TableLayoutView活动切换到GLSurfaceView活动时出现问题

Android 从TableLayoutView活动切换到GLSurfaceView活动时出现问题,android,opengl-es,Android,Opengl Es,从当前基于TableLayoutView的活动到基于GLSurfaceView的活动,我遇到了一个问题。每当我尝试切换意图并开始新活动时,我的应用程序就会崩溃。我已经在清单中注册了该活动。我在每个活动中都有一个onClickListener,等待特定的单击 第1类代码: public void onClick(View v) { // TODO Auto-generated method stub Intent myIntent = new Intent(); myInten

从当前基于TableLayoutView的活动到基于GLSurfaceView的活动,我遇到了一个问题。每当我尝试切换意图并开始新活动时,我的应用程序就会崩溃。我已经在清单中注册了该活动。我在每个活动中都有一个onClickListener,等待特定的单击

第1类代码:

public void onClick(View v) {
  // TODO Auto-generated method stub
    Intent myIntent = new Intent();
    myIntent.setClassName("foo.bar.thud", "foo.bar.thud.RotatingCube");
    Catalog.this.startActivity(myIntent);
}
第2类代码:

public void onClick(View v) {
    // TODO Auto-generated method stub
    Intent myIntent = new Intent();
    myIntent.setClassName("foo.bar.thud", "foo.bar.thud.Catalog");
    startActivity(myIntent);
}

通常,使用类对象本身不太容易出错:

Intent intent = new Intent(Catalog.this, RotatingCube.class);
Catalog.this.startActivity(intent);
另一个班级也一样

通过这种方式,编译器可以检查您引用的类是否确实存在

如果这不能解决问题,那么尝试在logcat中查找错误消息