Google 最近弃用了 IntentService:https ://android.googlesource.com/platform/frameworks/base.git/+/6f8b09029932dfd24945202017639754b00acc2e
IntentService 的文档现在说:
* @deprecated IntentService is subject to all the
* <a href="/preview/features/background.html">background execution limits</a>
* imposed with Android 8.0 (API level 26). Consider using {@link androidx.work.WorkManager}
* or {@link androidx.core.app.JobIntentService}, which uses jobs
* instead of services when running on Android 8.0 or higher.
那么 JobIntentService 和 WorkManager 有什么区别,在什么情况下推荐使用哪一个呢?
谷歌甚至没有在这个页面上提到 JobIntentService,他们只提到了 WorkManager:https ://developer.android.com/guide/background