Android 8.0 Oreo RunningServiceInfo returns 0 services

后端 未结 1 1325
予麋鹿
予麋鹿 2021-01-14 07:52

my Oneplus 5 just updated to Oreo and something has broken. I have a simple widget which starts and stops some service.

But now, when I request List of services I go

相关标签:
1条回答
  • 2021-01-14 08:18

    Quoting the documentation:

    This method was deprecated in API level 26. As of O, this method is no longer available to third party applications. For backwards compatibility, it will still return the caller's own services.

    So, if you do not have a service running, getRunningServices() will return an empty list on Android 8.0+.

    0 讨论(0)
提交回复
热议问题