Ah, thanks.

Either way, it means that the number of items in the list accessed by
getBroadcastItem is always equal to N.
The problem remains: How can getBroadcastItem(int) return null?

On Mar 13, 4:53 am, Dianne Hackborn <hack...@android.com> wrote:
> On Thu, Mar 12, 2009 at 8:08 PM, Streets Of Boston
> <flyingdutc...@gmail.com>wrote:
>
> > I thought that beginBroadcast() would lock the callback-list for
> > modification and finishBroadcast() would unlock it again. This way, N
> > should always be the number of items in this HashMap you were
> > mentioning. Am i correct in this.
>
> No, it only locks internally in beginBroadcast() to create the list.  If you
> may have multiple threads calling beginBroadcast(), they need to do their
> own synchronization, holding your own lock from before calling
> beginBroadcast() to after finishBroadcast().
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support.  All such questions should be posted on public
> forums, where I and others can see and answer them.
--~--~---------~--~----~------------~-------~--~----~
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