Keep in mind that this is not a one-time event. Rather it is an event
that the user generates, all I want those other activities to know is
whether or not the event was generated by the user while in the
background.

On Jun 8, 4:16 pm, Diego Tori <diegotoridoesandr...@gmail.com> wrote:
> That's the thing, if I set a shared preference flag or cached flag via
> cache object, and they did try to check for that value in onResume,
> wouldn't the first activity from the back stack to get the foreground
> check its state, then set it back to false after checking for it being
> true before having to do work? Even if I didn't reset the flag, every
> time it would hit that function, it would still get caught in that
> flag, so that isn't really useful. So there is no way that I can just
> broadcast one intent that my listening activities can listen to after
> the intent is sent as soon as they get the foreground again?
>
> On Jun 8, 3:16 pm, Mark Murphy <mmur...@commonsware.com> wrote:
>
>
>
>
>
>
>
> > On Wed, Jun 8, 2011 at 3:00 PM, Diego Tori
>
> > <diegotoridoesandr...@gmail.com> wrote:
> > > So I want to achieve the following: suppose I have one Activity in my
> > > app that generates an event that I want other Activities in my app's
> > > back stack to know about so they can react to it accordingly (i.e.
> > > update UI, refresh data via separate Thread, etc...). What strategies
> > > would I have to pursue in order to accomplish this?
>
> > Have them find out about the new information in onResume(). They do
> > not need the information before then, since they are not in the
> > foreground.
>
> > > Would I have to set up BroadcastReceivers and if so, how would I set
> > > up the receivers?
>
> > No.
>
> > > Also, for this case, would it make sense to register
> > > and un-register the receiver(s) in onCreate and onDestroy
> > > respectively, since using onResume and onPause would prevent it from
> > > listening in when receiving Activity is in the background?
>
> > No.
>
> > --
> > Mark Murphy (a Commons 
> > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> > Android 3.0 Programming Books:http://commonsware.com/books

-- 
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

Reply via email to