版本:libgdx 1.2.0
AVD模拟器版本:4.0
问题描述:例子中代码如下:
package com.sandy.test2; import com.badlogic.gdx.backends.android.AndroidApplication; import android.os.Bundle; public class Libgdx2Activity extends AndroidApplication{ /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
initialize(new HelloWorld(), false); //实例化ApplicationListener对象,并且传递给initialize()方法
} }
initialize(new HelloWorld(), false);
方法无效
提示:
The method initialize(ApplicationListener, AndroidApplicationConfiguration) in the type AndroidApplication is not applicable for the arguments (FirstGame, boolean)
查API结果如下:
据API 更改参数:
initialize(new HelloWorld());
AVD模拟器运行错误:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.guigu.mylibgdx/com.guigu.mylibgdx.HelloGameActivity}: com.badlogic.gdx.utils.GdxRuntimeException: Libgdx requires OpenGL ES 2.0
最终结论:
1 猜测原因 libgdx版本方法调整(未深入证实)
2 AVD模拟器不支持 OpenGL ES 2.0
解决方法:
修改方法,真机调试。(妈 X 的! 我也知道很C 蛋好不?! 有好方法请速告知!)
另附小米4(MI4)开发者模式打开:
设置---关于手机--- MIUI版本
多点那个几下便在 设置 中 出现 开发者选项