glSurfaceView和相机onResume问题
我已经成功实现了混合相机和 glsurfaceview 显示。然而,按下主屏幕并返回应用程序后,glsurfaceview 隐藏在相机视图后面(我相信)。如果通过按后退键(使用 finish())重新运行应用程序,则两个视图都显示正常。
关于如何在 onResume 上重新初始化的任何指示?我目前在 onPause 方法中调用 finish() 作为解决方法,但这会产生副作用,即在按下电源按钮或屏幕在一段时间后关闭时退出应用程序。
I have successfully implemented a mixed camera and glsurfaceview display. However, after pressing the home screen and returning to the app, the glsurfaceview is hidden behind the camera view (I believe). If rerunning the app from a back key press, which uses finish(), both views display ok.
Any pointers on how to reinitialise on a onResume? I am currently calling finish() in the onPause method as a workaround but this has the side effect of exiting the app when the power button is pressed or the screen turns off after an amount of time.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更新,经过一些广泛的测试后,bringToFront() 并没有真正起作用,它产生了其他问题。然而 glSurfaceView 上的 setZOrderOnTop(true) 确实有效。
Update, bringToFront() didn't really work after some extensive testing, it created other problems. However setZOrderOnTop(true) on the glSurfaceView did work.