In my android app I use
org.greenrobot.eventbus.EventBus;
1.I create event:
public class NotLoginEvent {
}
In my fragment send this event:
EventBus.getDefault().post(new NotLoginEvent());
And in activity I receive this event:
@Subscribe() public void onNotLoginEvent(NotLoginEvent notLoginEvent) { // do something }
Nice. It's work fine.
But as you can see the class NotLoginEvent
is empty. So is it good to send empty class? Maybe has another solution. I wan't to create empty class to send message.