You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Repro steps or stacktrace: No stacktrace
I followed offcial tutorial of android develop to build a UI which uses 'ViewPage2' and 'Tablayout':
There are one parent fragment and two children fragment as view pages.
Inside children fragment view page, there is 'RecyclerView'. And there is a button inside item view of 'RecyclerView', and it uses 'AutoDispose2' and 'RxBinding' to subscribe to 'click' event by using children fragment as 'LifeCyclerOwner'.
Inside children fragment view page, there is 'EditText' of which event is also subscribed via 'AutoDispose2' and 'RxBinding' by using children fragment as 'LifeCyclerOwner'.
Before children fragment view page is changed by swiping, event is consumed as expectation. BUT, after children fragment view page is changed, subscritpion of button inside Item view of 'RecyclerView' is unsubscribed, WHILE subscription of 'EditText' outside 'RecyeclerView' but in the same fragment view page with the same 'LifeCyclerOwner' still WORKS!
I tried to debug why this happens by:
i. Comment out '.to(autoDisposable(AndroidLifecycleScopeProvider.from(m_lifecycleOwner)))' of subscription to button inside item view of 'RecyclerView', the subscrption sustained after fragment view page change, and even is consumed.
ii. I use the raw event listen pattern without any Rx patten to verify whether 'click' event of button is fired. 'Click' event did fire after fragment view page change.
iii. I changed 'LifeCyclerOwner' ti parent fragment, and everything works fine.
iv. I use '@OnLifecycleEvent(Lifecycle.Event.ON_ANY)' to log state change, but only get 4 state: PRE_ON_CREATE, CREATED, STARTED, RESUMED.
My question is, what causes 'AutoDispose2' unsubscribed from the button inside item view of 'RecyclerView' after view page change, while subscrition of 'EditText' in the same children fragment with the same 'LifeCyclerOwner' still works?
The text was updated successfully, but these errors were encountered:
Library version: 2.0.0
Repro steps or stacktrace: No stacktrace
I followed offcial tutorial of android develop to build a UI which uses 'ViewPage2' and 'Tablayout':
i. Comment out '.to(autoDisposable(AndroidLifecycleScopeProvider.from(m_lifecycleOwner)))' of subscription to button inside item view of 'RecyclerView', the subscrption sustained after fragment view page change, and even is consumed.
ii. I use the raw event listen pattern without any Rx patten to verify whether 'click' event of button is fired. 'Click' event did fire after fragment view page change.
iii. I changed 'LifeCyclerOwner' ti parent fragment, and everything works fine.
iv. I use '@OnLifecycleEvent(Lifecycle.Event.ON_ANY)' to log state change, but only get 4 state: PRE_ON_CREATE, CREATED, STARTED, RESUMED.
My question is, what causes 'AutoDispose2' unsubscribed from the button inside item view of 'RecyclerView' after view page change, while subscrition of 'EditText' in the same children fragment with the same 'LifeCyclerOwner' still works?
The text was updated successfully, but these errors were encountered: