简体   繁体   English

通话后黑屏

[英]Blank screen after phone call

I have written a game app which is in the final stages of testing. 我编写了一个游戏应用程序,该应用程序处于测试的最后阶段。 I am now checking it can recover from a variety of pause/resume events. 我现在正在检查它是否可以从各种暂停/恢复事件中恢复。 All is working fine on my google nexus, but on my samsung galaxy Y, if a phone call comes in during gameplay, then when the call ends, the game screen is black. 在我的Google Nexus上一切正常,但在三星银河Y上,如果在游戏过程中打了电话,则通话结束时,游戏屏幕为黑色。 The game has not crashed, the sounds are still playing and if I press the menu button I see the menus appear - I can even select "about" and then see a dialog window appear and make it disappear again by clicking ok. 游戏尚未崩溃,声音仍在播放,如果我按菜单按钮,我会看到菜单出现-我什至可以选择“关于”,然后看到一个对话框,然后单击“确定”使其消失。 I can even complete the game (blind) and see the end of game dialog appear correctly. 我什至可以完成游戏(盲注),然后看到游戏结束对话框正确显示。 There are no errors reported in logcat. logcat中未报告任何错误。 If I run the program in the debugger, I can see the program repeatedly stepping through all the drawing routines and finally call unlockCanvasAndPost(canvas). 如果我在调试器中运行该程序,则可以看到该程序反复执行所有绘制例程,最后调用unlockCanvasAndPost(canvas)。

The graphics are being drawn in their own separate thread. 图形是在它们自己的单独线程中绘制的。

What kind of things could be preventing the display of my graphics? 什么样的情况会阻止图形显示?

I had an instance of setDrawingCacheEnabled(true); 我有一个setDrawingCacheEnabled(true)的实例; in my program. 在我的程序中。 As soon as this was removed the problems disappeared. 一旦将其删除,问题就消失了。 I confess I don't understand how this prevented graphics from being drawn or why the graphics work perfectly up until the phone call comes in. 我承认我不明白这是如何阻止绘制图形的,或者为什么直到电话打入之前图形仍能正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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