This example describes passing an event using the Otto Event Bus.
To use the Otto Event Bus in Android Studio you have to insert the following statement in your modules gradle file:
dependencies {
compile 'com.squareup:otto:1.3.8'
}
The event we'd like to pass is a simple Java object:
pu...
To receive an event it is necessary to implement a method with the event type as parameter and annotate it using @Subscribe. Furthermore you have to register/unregister the instance of your object at the BusProvider (see example Sending an event):
public class MyFragment extends Fragment {
pri...