识别应用程序何时从空白屏幕返回
在黑屏后,是否可以知道我的应用程序何时返回用户视图?此时应用程序调用方法 onResume,并且我的应用程序崩溃了。 (“意外停止”)我知道为什么,我可以修复这个问题,但我需要知道应用程序何时从空白屏幕返回。
Is it possible to get know when my application returns to view for user, after blanking screen? In this moment application calls method onResume, and my application has crash. ("has stopped unexpectedly") I know why and I can repair this problem, but I need to know when application returns from blank screen.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您正在谈论用户解锁设备的时间点 - ACTION_USER_PRESENT 是你所需要的。如果情况并非如此 - 请详细说明并发布更多详细信息
If you're talking about the point when user unlocks the device - ACTION_USER_PRESENT is what you need. If this is not the case - please elaborate and post more details
“黑屏后”是什么意思?就像屏幕超时并关闭一样?无论哪种方式,我们几乎不可能仅凭您提供的信息来帮助您。发布 onResume() 方法中的代码,同时查看 Logcat 并复制来自您收到的异常的堆栈跟踪。也将其发布在这里。一旦您完成此操作,我们就更有可能帮助您解决问题。
What do you mean by "after blanking screen" ? like if the screen times out and turns off? Either way it will be mostly impossible for us to help you with only the information you've given. Post the code from your onResume() method, also look in the Logcat and copy the stack trace that comes from the exception you're getting. Post that here too. Once you have done this it is far more likely that we can help you resolve the problem.