On 4 nov, 09:46, Nicolas Antoniazzi <
nicolas.antonia...@gmail.com>
wrote:
> Hello,
>
> This is just a quick question to gwt developpers to know what is the reason
> to pass the EventBus to the start() method of Activity ?
> Is there something special about this instance ?
Yes, it's actually a ResettableEventBus, so any handler added to it
will automatically be removed when the activity is stopped/cancelled,
and you don't have to track HandlerRegistrations yourself.
Here's what the Javadoc says:
"""Any handlers attached to the provided event bus will be de-
registered when the activity is stopped, so activities will rarely
need to hold on to the HandlerRegistration instances returned by
EventBus.addHandler(com.google.gwt.event.shared.GwtEvent.Type, H)."""
http://google-web-toolkit.googlecode.com/svn/javadoc/2.1/com/google/gwt/activity/shared/Activity.html#start(com.google.gwt.user.client.ui.AcceptsOneWidget,
com.google.gwt.event.shared.EventBus)