We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
大佬,请教一个问题
HomeActivity首页由多个Fragment组成,通过 NavigationController切换。 在HomeActivity中如下订阅事件:
RxBusManager.subscribeEnquiryOrOrderList(this, new RxBus.Callback<String>() { @Override public void onEvent(String s) { switch (s) { case ENQUIRY_AUTO: navigationController.setSelect(1); checkPriceListFragment.jump(s); break; case ENQUIRY_MANUAL: navigationController.setSelect(1); checkPriceListFragment.jump(s); break; case ORDER_AUTO: navigationController.setSelect(2); orderFragment.jump(s); break; case ORDER_MANUAL: navigationController.setSelect(2); orderFragment.jump(s); break; } } });
然后连续打开了3个Activity,在第三个Activity中发送事件,并依次finish这3个Activity。
//跳转到人工询价列表 RxBusManager.postToEnquiryOrOrderList(ENQUIRY_MANUAL); ActivityManager.removeActivitis(new String[]{"CActivity", "BActivity", "AActivity"});
但是HomeActivity并不会接收到该事件,这是什么原因?是我的使用方式有问题吗?
我在只跨一个Activity的情况下,这种使用方式是可行的,而且是先调用finish再发送订阅事件。
The text was updated successfully, but these errors were encountered:
我搞错了,只跨一个Activity的情况也是不行的。
我想请教下,跨Activity能否实现发送和接受订阅事件?
Sorry, something went wrong.
使用sticky的post和subscribe成功实现了这个需求。
但是逻辑上我还是有点疑惑,HomeActivity中先subscribe,为什么会接收不到后post的事件?
正常订阅之后就可以收到,如果要先发送后订阅那就用 sticky,实现是没有问题的,你可以自己打 Log 或者断点调试测试。
No branches or pull requests
大佬,请教一个问题
HomeActivity首页由多个Fragment组成,通过 NavigationController切换。
在HomeActivity中如下订阅事件:
然后连续打开了3个Activity,在第三个Activity中发送事件,并依次finish这3个Activity。
但是HomeActivity并不会接收到该事件,这是什么原因?是我的使用方式有问题吗?
我在只跨一个Activity的情况下,这种使用方式是可行的,而且是先调用finish再发送订阅事件。
The text was updated successfully, but these errors were encountered: