public class SimpleEventBus extends Object implements EventBus
EventBus implementation that wraps Bus provided by the Otto
library. Simple bus need to be created with an instance of Otto's bus via SimpleEventBus(Bus).
The wrapped bus may be than obtained via getBus() if needed.| Modifier and Type | Field and Description |
|---|---|
protected Bus |
mBus
Deprecated.
Use
getBus() instead. |
| Constructor and Description |
|---|
SimpleEventBus()
Same as
SimpleEventBus(Bus) with default instance of Bus. |
SimpleEventBus(Bus bus)
Creates a new instance of SimpleEventBus that wraps the specified bus.
|
| Modifier and Type | Method and Description |
|---|---|
Bus |
getBus()
Returns the original bus wrapped.
|
void |
post(Object event)
Delegates to
Bus#post(Object). |
void |
register(Object object)
Delegates to
Bus#register(Object). |
void |
unregister(Object object)
Delegates to
Bus#unregister(Object). |
@Deprecated protected final Bus mBus
getBus() instead.public SimpleEventBus()
SimpleEventBus(Bus) with default instance of Bus.public SimpleEventBus(Bus bus)
bus - The bus to be wrapped.getBus()public final Bus getBus()
SimpleEventBus(Bus)public void register(Object object)
Bus#register(Object).register in interface EventBusobject - The desired object to register.EventBus.unregister(Object)public void unregister(Object object)
Bus#unregister(Object).unregister in interface EventBusobject - The desired object to unregister.EventBus.register(Object)