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

rxBus注解问题 #31

Open
SimpleGentleman opened this issue Sep 7, 2018 · 2 comments
Open

rxBus注解问题 #31

SimpleGentleman opened this issue Sep 7, 2018 · 2 comments

Comments

@SimpleGentleman
Copy link

如demo中所示:同一个AuthorEvent对象,但是post发送参数也都是AuthorEvent,如果我有两个接受不同的事件(携带的都是AuthorEvent,但是要做的是不一样的,怎么区分);
因此,我想起,post可以携带参数发送,即post("tag",AuthorEvent);但是我发现你这个框架中,接收事件注解类
@retention(RetentionPolicy.RUNTIME)
@target(ElementType.METHOD)
public @interface Subscribe {
ThreadMode threadMode() default ThreadMode.MAIN_THREAD;
}
有问题,
@subscribe 后面没法添加(“tag”),编译报错,请问如何修改 @interface Subscribe 这个接受事件注解类呢?

@xiaoyaoyou1212
Copy link
Owner

@SimpleGentleman 如果需要携带参数,可以在事件AuthorEvent中定义一个变量来携带,发送事件时传入不同的值就行。

@SimpleGentleman
Copy link
Author

这也到是一种思路,也行,谢谢哈。

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