-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Labels
Description
I don't know if this makes sense to you, but it might be useful in some cases (avoids sending events from one to another). I don't know the best way to run this on scenarios with more than one class listening to SomeEvent.
// ... some class listening to SomeEvent
public int onEvent(SomeEvent event) {
if (event.message.equals("something")) {
return 1;
}
return 0;
}
// ... some class that triggers a SomeEvent
public void whichValue() {
EventBus.getDefault()
.post(new SomeEvent("something"), new OnResult() {
public void onResult(int result) {
// do something with result
}
});
}