需要https://github.com/square/otto的帮助。
在我的申请中我有
ActivityBase
:
@Override
protected void onResume() {
super.onResume();
SmartApplication.bus.register(this);
}
@Override
protected void onPause() {
super.onResume();
SmartApplication.bus.unregister(this);
}
ActivityOperationBase extends ActivityBase
:
@Subscribe
public void onNextStepRequest(NextStepRequestEvent event) {
//...
}
ActivityMobile extends ActivityOperationBase
,其中包含FragmentCommonEnterMoney
。这个片段有按钮
SmartApplication.bus.post(new NextStepRequestEvent(/*params*/));
点击它。但它不会发射
@Subscribe
public void onNextStepRequest(NextStepRequestEvent event) {
//...
}
我做错了什么?