Comments (7)
I think we should provide some examples of how to hook one up, but I don't think we should ship something first party. Especially with support library variants out there, kind of makes a mess and most people just implement it in their own base classes I think. Can revisit if Android APIs improve in the future for external observation.
from autodispose.
Activities have ActivityLifecycleCallbacks.
from autodispose.
True, but we can't query the current state of the activity for lifecycle resolution :/. Most we could do would basically be to dispose on destroy, but wouldn't be able to tell if we're already after the lifecycle
from autodispose.
Do you need to query the current state of the activity? You should get all edges of the state machine in the callbacks instance, and infer state from that. Unless there are edge cases I'm not thinking of.
from autodispose.
Say you subscribe after onDestroy, how would you know since no callbacks would ever fire?
from autodispose.
I think some code in Glide do the similar things.
ManagerRetriever.java#319
It attach a Invisible fragment to activity or fragment, as it can receive the lifecycle callback form them.
from autodispose.
You can get callbacks, but you can't query the current state right?
from autodispose.
Related Issues (20)
- crash by fragment in removing state HOT 1
- ViewScopeProvider throws when Activity restarts. HOT 5
- Question: Incompatible with RxJava 2? HOT 4
- Unsubscribe unexpectedly when used in item of 'RecyclerView' inside 'ViewPager2' after page changed. HOT 1
- how to remove warning Missing Disposable handling: Apply AutoDispose or cache the Disposable instance manually and enable lenient mode. HOT 1
- I need AutoDispose proguard
- Help ,Why the main thread is required ? HOT 3
- Integrate kotlin ABI validator
- Please ignore
- Please ignore
- Obseravable called twice when completable scope. #416 HOT 3
- Unusable with lint 7.0.0-alpha14 (Jetpack Compose project) HOT 4
- How to use it in MVVM? HOT 2
- gradle 7.1 and AGP 7.0.0-beta05 HOT 3
- Snapshots and Building from source HOT 1
- Leak - DetachEventCompletable isn't removed when View is removed from ViewTree HOT 1
- lint lenient mode do not support kotlin lambda/when/if expressions HOT 1
- Question: how to implement a custom LifecycleScopeProvider HOT 1
- ERROR: R8: Missing class com.google.errorprone.annotations.DoNotMock (referenced from: autodispose2.ScopeProvider and 1 other context) HOT 3
- Service loader file missing in error prone plugin
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autodispose.