diff --git a/android/autodispose-android/src/main/java/com/uber/autodispose/android/ViewAttachEventsObservable.java b/android/autodispose-android/src/main/java/com/uber/autodispose/android/ViewAttachEventsObservable.java index 7a7c2f3cb..17beef1fb 100644 --- a/android/autodispose-android/src/main/java/com/uber/autodispose/android/ViewAttachEventsObservable.java +++ b/android/autodispose-android/src/main/java/com/uber/autodispose/android/ViewAttachEventsObservable.java @@ -49,6 +49,9 @@ final class ViewAttachEventsObservable extends Observable { observer.onNext(ViewLifecycleEvent.ATTACH); } view.addOnAttachStateChangeListener(listener); + if (listener.isDisposed()) { + view.removeOnAttachStateChangeListener(listener); + } } static final class Listener extends MainThreadDisposable