Receiving Events

suggest change

For receiving events you need to register your class on the EventBus.

@Override
public void onStart() {
    super.onStart();
    EventBus.getDefault().register(this);
}

@Override
public void onStop() {
   EventBus.getDefault().unregister(this);
   super.onStop();
}

And then subscribe to the events.

@Subscribe(threadMode = ThreadMode.MAIN)
public void handleEvent(ArbitaryEvent event) {
    Toast.makeText(getActivity(), "Event type: "+event.getEventType(), Toast.LENGTH_SHORT).show();
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents