On Thu, Feb 16, 2012 at 10:52 AM, Weston Weems <[email protected]> wrote:
> Thanks for the tip. If I understand the source right, the idea is that
> when those events occur, you just broadcast it... say like {some
> network error message}... and have my base activity listen for those
> broadcasts?

Yup, with the activity only having a high-priority receiver registered
when it is in the foreground.

> Then because they are implemented on an activity, I should
> theoretically be able to do something like Dialog d = new
> Dialog(this); keeping reference to the current class?

Yes.

> 1) Would you have problems with multiple activities responding to the
> same broadcast?

Not with an ordered broadcast, if the activity that receives it aborts
the broadcast. Then, at most one component will get the broadcast.

That being said, I have not pounded on this mechanism in a complex
app, and therefore there could be issues that I am not aware of (e.g.,
the component that winds up with the broadcast is the activity that's
departing the screen).

-- 
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to