Vote count:
0
I am registering and unregistering for an event in Parent Activity. And I have public onEvent methods in both parent and child activity. My onEvent in the child activity does not trigger. Does someone know why? What needs to be done for both the onEvents to trigger?
@Override
public void onResume() {
super.onResume();
try {
if (!EventBus.getDefault().isRegistered(this))
EventBus.getDefault().register(this);
} catch (Exception e) {
}
}
@Override
public void onPause() {
super.onPause();
try {
if (EventBus.getDefault().isRegistered(this))
EventBus.getDefault().unregister(this);
} catch (Exception e) {
}
}
asked 1 min ago
With Greenrobot Eventbus library, how does it work with parent and child activity?
Aucun commentaire:
Enregistrer un commentaire