LifecycleService是否与lifecycle-extensions工件一起弃用?

问题描述 投票:1回答:1

似乎以前存在于lifecycle-extensions工件中的LifecycleService类在任何当前推荐的工件中均不可用。我希望它在lifecycle-runtime中,这是没有ViewModel和LiveData的,但LifecycleService不在lifecycle-viewmodellifecycle-livedata中。

LifecycleService是否已弃用?

Source on current Lifecycle artifacts

android deprecated androidx android-architecture-components android-architecture-lifecycle
1个回答
1
投票

否,根据LifecycleServicelifecycle-serviceLifecycle 2.2.0 release notes依赖项中。

lifecycle-extensions工件弃用:通过上述ViewModelProviders.of()弃用,此版本标志着lifecycle-extensions中最后一个API的弃用,现在应认为该工件已完全弃用。我们强烈建议您根据需要的特定生命周期工件(如果使用lifecycle-service,则使用例如LifecycleService;如果使用lifecycle-process,则使用ProcessLifecycleOwner),而不要使用生命周期扩展。不是2.3.0的未来lifecycle-extensions版本。

© www.soinside.com 2019 - 2024. All rights reserved.