I\'m trying to do this: http://android-er.blogspot.com/2012/06/communication-between-fragments-in.html Except that I\'m using a FragmentStatePagerAdapter
I have an
I use Mr. Rodion's solution above. But in addition, Android Studio asked me to add @Subscribe
annotation before onEvent
method.
Like this:
@Subscribe
public void onEvent(TextChangedEvent event) {
textView.setText(event.newText);
}
According to EventBus’ API:
Subscribers implement event handling methods (also called “subscriber methods”) that will be called when an event is posted. These are defined with the @Subscribe annotation. Please note that with EventBus 3 the method name can be chosen freely (no naming conventions like in EventBus 2).