简体   繁体   中英

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM