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

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

问题描述

我不知道用什么方法这个按钮调用。

I'm wondering what method this button calls.

我的比赛总是暂停/恢复正常,除非我用这个按钮,它看起来像此键不叫的onPause() 的onResume()的方法。 它的工作原理,如果我退出游戏,去到另一个窗口(比如一个在图片),然后用此键来恢复。但如果我只是preSS这个按钮,当游戏中,游戏会暂停,但线程dosnt简历像它隔时间到,比赛只是一种静止在屏幕上闪烁了一下。

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!

推荐答案

无标准活动的生命周期方法被调用时,最近的应用程序按钮pressed。最近的应用程序列表弹出窗口后,活动将保持活跃。通过这个列表,你甚至可以看到应用程序的动画仍然在运行,如果运行游戏的一些动画没有处理这种情况下适当的半透明左侧部分。其实很多游戏在谷歌播​​放不处理这种情况正常,即使是好的,像愤怒的小鸟。

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.

当用户打开最近的应用程序列表(或返回),唯一的活动方式也越来越被称为是<一个href="http://developer.android.com/reference/android/app/Activity.html#onWindowFocusChanged%28boolean%29">onWindowFocusChanged与布尔参数 hasFocus 。当最近的应用方法 onWindowFocusChanged()调用 hasFocus 用户开放列表等于,并呼吁与 hasFocus 同样的方法等于当用户pressing早在这个名单

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.

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

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