Sunday, August 7, 2011

Re: [android-developers] Broadcast Receivers: Can they execute simultaneously or do they always execute consecutively?

On Sun, Aug 7, 2011 at 7:03 AM, Ali Chousein <ali.chousein@gmail.com> wrote:
> I have a little confusion with broadcast receivers. I have a broadcast
> receiver which is triggered upon TIME_SET and TIMEZONE_CHANGED actions
> (the code is given below). What I was wondering is, can
> OnDateTimeChanged (see the code below) be triggered simultaneously
> (and its execution overlaps) when both TIME_SET and TIMEZONE_CHANGED
> actions are triggered or is one always going to be triggered after the
> other?

Within the same process, they will execute consecutively, simply
because onReceive() is called on the main application thread.

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

_The Busy Coder's Guide to *Advanced* Android Development_ Version 2.0
Available!

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment