Any idea why RxBinding registered with RxView.clicks(buttonView) stops triggering after fragment replace inside activity. My activity can replace fragment multiple times.
My fragment code looks like the following:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
....
//this code works before and after fragment replace
plus_view.setOnClickListener(v -> {presenter.increaseLevel(getCurrentLevel());});
// below code stops working after fragment replace
// compositeDisposables.add(RxView.clicks(plus_view).subscribe(o ->
// {
// System.out.println("presenter getCurrentLevel Called");
// presenter.increaseLevel(getCurrentLevel());
//
// }));
....
}
After further digging I realized the binding was lost because I did not recreate the CompositeDisposable() after fragment was destroyed. All working now, closing the issue.
Any idea why RxBinding registered with RxView.clicks(buttonView) stops triggering after fragment replace inside activity. My activity can replace fragment multiple times.
My fragment code looks like the following:
inside my Activity I do the following:
full source with latest commit can be found here: https://github.com/davida5/AwesomeNotes/tree/repositoryPattern