如何检测“最近的应用程序"系统按钮点击次数(Honeycomb+) [英] How to detect "Recent Apps" system button clicks (Honeycomb+)

查看:34
本文介绍了如何检测“最近的应用程序"系统按钮点击次数(Honeycomb+)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道这个按钮调用了什么方法.

I'm wondering what method this button calls.

我的游戏总是正确暂停/恢复,除了当我使用这个按钮时,这个按钮似乎没有调用 onPause()onResume() 方法Activity.如果我退出游戏,转到另一个窗口(如图片上的那个),然后使用此按钮继续,它会起作用.但是如果我只是按下这个按钮,在游戏中,游戏会暂停,但线程不会像每隔一次那样恢复,游戏只是在屏幕上静止不动并闪烁一点.

My game always pauses/resumes correctly except for when I use this button, its seems like this button doesn't call the onPause() and onResume() methods of an Activity. It works if I exit the game, go to another window(like the one on the picture) and then use this button to resume. But If I just press this button, when ingame, the game pauses but the thread dosnt resume like it does every other time, the game kind of just stands still on screen and flickers a bit.

难以解释,但我希望我说的很清楚,如果没有,请询​​问!

Hard to explain but I hope I'm being sort of clear, if not, ask!

推荐答案

None of standard Activity Lifecycle 方法在按下最近的应用程序"按钮时调用.在最近的应用程序弹出列表后,活动将保持活动状态.通过此列表的半透明左侧部分,您甚至可以观察到应用程序动画仍在运行,如果您运行的游戏的某些动画没有正确处理这种情况.实际上,Google Play 中的许多游戏都没有正确处理这种情况,即使是好游戏,例如《愤怒的小鸟》.

None of standard Activity Lifecycle methods is called when "Recent Apps" button pressed. Activity will stay active after list of recent apps popups. Through semi-transparent left part of this list you can even observe application animation is still running, if you running a game with some animation that didn't handle this situation properly. Actually many of games in Google Play didn't handle this situation properly, even good ones, like Angry Birds.

当用户打开最近的应用程序"列表(或从中返回)时,唯一会调用的 Activity 方法是 onWindowFocusChanged 带有布尔参数 hasFocus.当用户打开使用 hasFocus 调用的最近应用程序方法 onWindowFocusChanged() 的列表等于 false,并且使用 hasFocus 调用的相同方法时> 等于 true 当用户在此列表中按 Back 时.

The only Activity method are getting called when user opens "Recent Apps" list (or returns from it) is onWindowFocusChanged with boolean parameter hasFocus. When user open list of Recent App method onWindowFocusChanged() called with hasFocus equals false, and same method called with hasFocus equals true when user pressing Back in this list.

这篇关于如何检测“最近的应用程序"系统按钮点击次数(Honeycomb+)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆