Foreground service is killed in Android 10

醉酒当歌 提交于 2020-06-17 13:13:05

问题


In Android 10, some manufacturer comes with the new feature in a battery optimization setting (see the picture). My foreground service getting killed by OS after some time when the screen is off.

I have used the foreground service with notification. This code is working well when the screen is ON in all devices. I am facing this issue in OnePlus and realMe device, both having an android 10 OS.

I want to know, Is there any way to solve this problem? Is there any way to know in my device is having such kind of setting?

Thanks for help!

来源:https://stackoverflow.com/questions/62305294/foreground-service-is-killed-in-android-10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!