jdeferred / jdeferred

Java Deferred/Promise library similar to JQuery.

Home Page:jdeferred.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handle Android Lifecycle

saturnism opened this issue · comments

Android has lifecycles like pause and destroy.

AndroidDeferredManager may not be able to listen to these lifecycles directly. However, it would be nice to provide convenience methods so that activities that needs to respond to lifecycle can call easily, e.g., adm.destroy(), or adm.pause().

What would these methods do? ADM does not have any specific links to the Android lifecycle at the moment.

https://developer.android.com/guide/components/activities/activity-lifecycle.html

What I heard is to potentially stopping or cancelling tasks. Sounds straight forward with access to the executor service.

If we expose some methods, it'll prob be specific to DeferredManager lifecycle, and won't be mapped 1-to-1 to Android lifecycle. But can still be useful, to say, cancel all tasks.