如何得到通知时,在Android的活动/任务的变化任务、通知、Android

由网友(威龙丶断魂神狙)分享简介:我建立一个系统状态记录器。我想,当任何活动/任务被带到堆栈停止收到通知,并且由用户(不只是我写的一个)变得可见。I'm building a system status logger. I'd like to be notified when any activity/task is brought to the s...

我建立一个系统状态记录器。我想,当任何活动/任务被带到堆栈停止收到通知,并且由用户(不只是我写的一个)变得可见。

I'm building a system status logger. I'd like to be notified when any activity/task is brought to the stop of the stack and becomes visible by the user (not just the one I wrote).

ActivityManager能够制定出什么在上面:    http://developer.android.com/reference/android/app/ActivityManager.html

ActivityManager makes it possible to work out what's on top: http://developer.android.com/reference/android/app/ActivityManager.html

不过,这需要我经常民意调查,以重新计算什么在上面浪费了大量的资源。有没有一种方法来接收事件/回调/通知,当一个活动的变化?

however, this requires that I frequently poll to recalculate what's on top wasting a lot of resources. Is there a way to receive an event/callback/notification when an activity changes?

**编辑**要清楚 - 我要当的任意的活动成为活动的活动通知

** edit ** To be clear -- I want to be notified when any activity becomes the active activity.

推荐答案

onResume()活动时谈到生活状态叫。

onResume() is called when activity comes to live state.

阅读全文

相关推荐

最新文章