Skip to content

If Subscriber was unsubscribed once it won't receive onNext next time somebody will subscribe using it #1535

Closed
@lexer

Description

@lexer
private Subscriber<Location> onLocationUpdated = new Subscriber<Location>() {
    @Override
    public void onNext(Location location) {
       // never called when was resumed after pause
    }
    ...
}

Subscription subscription = Subscriptions.empty();
void onResume() {
    subscription = locationService.observe().subscribe(onLocationUpdated);
}

void onPause() {
    subscription.unsubscribe();
}

I have a class field with subscriber implementation. When my UI resumed I subscribe using that subscriber on location updates. When UI is paused I unsubscribe.

Subscriber is field is not destroyed when UI is paused and should be reused for subscribe on UI resume. Unfortunately onNext will be never called.

Guess this related to this fix #1409.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions