gpt4 book ai didi

java - 如何修复 api 21 的 context.getSystemService(class)?

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:07:34 24 4
gpt4 key购买 nike

我正在关注 JobScheduler 的视频:

https://www.youtube.com/watch?v=XFN3MrnNhZA

但是 lint 告诉我 context.getSystemService(class)api 23。 那么我是不是遗漏了什么或者 android 是否用那里的 api 改变了什么?

注意:主要想知道 JobScheduler 是否在 api 21 中引入 如果没有 getSystemService(Class)

它会如何工作

谢谢。

最佳答案

感谢 Reghunandan,我使用以下方法找到了更好的解决方案:

github.com/firebase/firebase-jobdispatcher-android

但如果有人遇到同样的问题,那就是错误:

getSystemService(Class) API 23

应该是:

getSystemService(String) API 1

getSystemService(context.JOB_SCHEDULER_SERVICE) API 21

关于java - 如何修复 api 21 的 context.getSystemService(class)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47814971/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com