Skip to content
This repository has been archived by the owner on Mar 29, 2022. It is now read-only.

发送事件无效 #26

Open
q876625596 opened this issue Jun 13, 2018 · 5 comments
Open

发送事件无效 #26

q876625596 opened this issue Jun 13, 2018 · 5 comments

Comments

@q876625596
Copy link

我的一个activity里面有一个viewPager+fragment,activity和viewPager中的fragment都注册了Apollo,但是在某一个fragment中发送两个事件,一个是向activity中发送,另一个是向别的fragment中发送,只会生效其中一个

@Sloaix
Copy link
Owner

Sloaix commented Jun 13, 2018

发送的TAG是一样的吗?

@Sloaix
Copy link
Owner

Sloaix commented Jun 13, 2018

发送前先确认另外一个Fragment已经Bind了Apollo,如果发送的时候Bind还未被执行,也是接收不到的。这个时候请使用@stick注解,同时emit加上stick = true的参数。

建议你断点看一下。

@Sloaix Sloaix closed this as completed Jun 20, 2018
@q876625596
Copy link
Author

不好意思最近有点忙,没来得及看,我的fragment和activity都是bind了的,而且都是在onCreate里面bind的,也试过加stick,但是都不行

@Sloaix
Copy link
Owner

Sloaix commented Jun 26, 2018

我明天写个demo看一下。

@Sloaix Sloaix reopened this Jun 26, 2018
@q876625596
Copy link
Author

好的,我的场景比较复杂,viewPager的嵌套就有两层,有些是粘性事件,有些又是普通的事件

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

No branches or pull requests

2 participants