libgdx使用了全屏模式之后,在某些机型会出现崩溃的情况,两年前就存在了,一直到现在为止,官方都没进行修复,其崩溃原因就是在源码AndroidGraphics.java中的onPause可以看到这样子的一段代码:
void pause () { synchronized (synch) { if (!running) return; running = false; pause = true; while (pause) { try { // TODO: fix deadlock race condition with quick resume/pause. // Temporary workaround: // Android ANR time is 5 seconds, so wait up to 4 seconds before assuming // deadlock and killing process. This can easily be triggered by opening the // Recent Apps list and then double-tapping the Recent Apps button with // ~500ms between taps. synch.wait(4000); if (pause) { // pause will never go false if onDrawFrame is never called by the GLThread // when entering this method, we MUST enforce continuous rendering Gdx.app.error(LOG_TAG, "waiting for pause synchronization took too long; assuming deadlock and killing"); android.os.Process.killProcess(android.os.Process.myPid()); } } catch (InterruptedException ignored) { Gdx.app.log(LOG_TAG, "waiting for pause synchronization failed!"); } } } }
新闻名称:Libgdx解决部分Android机型锁屏崩溃的方法-创新互联
当前地址:https://www.cdcxhl.com/article44/dooghe.html
成都网站建设公司_创新互联,为您提供网站营销、关键词优化、营销型网站建设、企业建站、App开发、全网营销推广
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联