Make sure the surfaceView or associated SurfaceHolder has a valid Surface
I 开发者_开发百科use OpenGL in LockScreen in android 2.2. When the device run in LockScreen, it get the following error : java.lang.IllegalArgumentException: Make sure the surfaceView or associated SurfaceHolder has a valid Surface...
Does anyone know what's problem causes it? I guess the context of LockScreen is different from the context of activty, so this reason causes this problem. But I am not sure.
This error caused by the return null value of env->GetIntField(native_window, gSurface_SurfaceFieldID) function in com_google_android_gles_jni_EGLImple.cpp. Gingerbread fixed this problem. They use other method to get the window value.
精彩评论