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 <[email protected]> wrote:
> On Thu, Mar 12, 2009 at 8:08 PM, Streets Of Boston
> <[email protected]>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
> [email protected]
>
> 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 [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