I didn't see onNewIntent(Intent) in the docs.  That would have been
really useful!

As it stands, I figured out another way.

If you have the Activity register the BroadcastReceiver
programatically (ie, not in the manifest file), the Activity can have
a reference to the BroadcastReceiver.  Then you can give the Activity
a listener interface and register it with the BroadcastReceiver.  So
instead of having the BroadcastReceiver fire an Intent, it just calls
the callback on the Activity.  You may have to set up a Runnable and
call runOnUiThread() on the Activity, but it works just fine.

-Cormac

On Feb 26, 5:44 pm, Sylvain Wallez <sylv...@apache.org> wrote:
> Cormac McCarty wrote:
> > Is it possible to update a currently running activity from a 
> > BroadcastReceiver?
>
> > I want to update my activity from a BroadcastReceiver that runs
> > alongside it.  When I run my app (from Eclipse), my activity starts.
> > When the BroadcastReceiver is triggered, it currently tries to start
> > the activity (with extras in the bundle...this is the important part),
> > but nothing happens, presumably because the activity is already
> > running.  So my question is, how do I get the new information to my
> > Activity (or even just tell the activity that there's new information
> > to get if I stick the information in a database)?  This seems like it
> > should be fairly straightforward, but I'm clearly missing something.
>
> Have you tried implementing Activity.onNewIntent(Intent)?
>
> Sylvain
>
> --
> Sylvain Wallez -http://bluxte.net
--~--~---------~--~----~------------~-------~--~----~
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