How to get a SurfaceHolder with a valid Surface (needed by EGL.eglCreateWindowSurface)?

偶尔善良 提交于 2019-12-03 13:52:14

The check valid for surface should be did when surface is created.So,surface.isValid() should be called in onSurfaceCreated or onSurfaceChanged,obviously,you should add surfaceholder.callback

Implement SurfaceHolder.Callback, and wait until you're told that the surface has been created. Also pay attention to when it is destroyed. You should only rely on the surface being valid between matching create and destroy calls.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!