确保surfaceView或关联的SurfaceHolder具有有效的Surface

发布于 2024-10-10 07:51:20 字数 235 浏览 0 评论 0原文

我在 android 2.2 的 LockScreen 中使用 OpenGL。当设备在 LockScreen 中运行时,会出现以下错误: java.lang.IllegalArgumentException: 确保 SurfaceView 或关联的 SurfaceHolder 具有有效的 Surface...

有谁知道是什么问题导致的?我猜LockScreen的上下文与activty的上下文不同,所以这个原因导致了这个问题。但我不确定。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冰之心 2024-10-17 07:51:20

此错误是由于 com_google_android_gles_jni_EGLImple.cpp 中的 env->GetIntField(native_window, gSurface_SurfaceFieldID) 函数返回 null 值引起的。姜饼解决了这个问题。他们使用其他方法来获取窗口值。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文