这段代码曾用于我的Nexus 7 2012 KitKat:
int[] maxSize = new int[1];
GLES10.glGetIntegerv(GL10.GL_MAX_TEXTURE_SIZE, maxSize, 0);
Run Code Online (Sandbox Code Playgroud)
在KitKat中我可以正确获取最大像素值,但在升级到工厂映像Lollipop后,这段代码会导致问题,因为它只返回0.当达到此方法时,logcat显示此输出:
E/libEGL? call to OpenGL ES API with no current context (logged once per thread)
Run Code Online (Sandbox Code Playgroud)
我已经android:hardwareAccelerated="true"在我的Manifest.xml中了.是否有任何我不知道的API更改,导致上述代码无法使用?请指教.