Skip to content
New issue

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

关于 @Subscriber(tag = "my_tag",mode = ThreadMode.POST) 接收不到消息 #42

Open
1277379283 opened this issue Oct 21, 2016 · 2 comments

Comments

@1277379283
Copy link

您好,看了您的博文 感觉非常受用,想跟您请教个问题,按照文档使用AndroidEventBus 发现 接收不到EventBus.getDefault().post("my_tag"); 传递过来的消息,不知如何解决,想跟您请教一二,发生这个事情问题会出现在哪?

MainActivity
@OverRide
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.act_home);
EventBus.getDefault().register(this);
}

@Subscriber(tag = "my_tag",mode = ThreadMode.POST)
private void updateUserWithTag() {
    ToastUtils.showShort(HomeActivity.this, "Passed parameters");
}

MyActivity
//发送消息
EventBus.getDefault().post("my_tag");

看到请您能够及时回复我,谢谢~~

@hehonghui
Copy link
Owner

@subscriber(tag = "my_tag",mode = ThreadMode.POST)
private void updateUserWithTag() {
ToastUtils.showShort(HomeActivity.this, "Passed parameters");
}

需要一个参数。

@1277379283
Copy link
Author

恩,非常感谢~我已解决,我原来以为只需要,不携带值传个tag 接收方就能做相应的事件

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants