Re: [android-developers] Hook event listeners for activity/application lifecycle events

2011-11-03 Thread Mark Murphy
On Wed, Nov 2, 2011 at 11:54 PM, Miles  wrote:
> Is there any way to to listen for activity/application lifecycle
> events without having to extend the classes?

In API Level 14, possibly -- see
Application.ActivityLifecycleCallbacks. I haven't seen these in use
yet.

On older versions of Android, no, there is no global listener
mechanism for these events.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Warescription: Three Android Books, Plus Updates, One Low Price!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Hook event listeners for activity/application lifecycle events

2011-11-02 Thread Miles
Hi,

Is there any way to to listen for activity/application lifecycle
events without having to extend the classes?

Reason for this is we are providing a component that needs to detect
when an activity/application is paused or resumed.  And for
convenience sake we don't want the client to have to notify the
component every time activity lifecycle changes.  If possible we just
want the component to hook into the lifecycle events and be informed
automatically by the android system.

We could make the component extend Activity and let the client extend
the component, but this would be more complicated for the client.  We
want to keep things simple for the client as possible even if it makes
our component more complex.

So is there a way to hook event listeners for lifecycle events?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en