Android 8 Foreground Service with Notification Channel

北慕城南 提交于 2019-12-21 17:46:19

问题


I want to start a foreground service in Android 8 and I want to know how are foreground services compatible with the notification channel system.

Let's say we start a foreground service, then we immediately create the required notification and assign it to a notification channel. Suddenly, the user decides to go into System Settings and disable the notification channel.

What happens in this case? Will the service become a background service? Does it get killed? I haven't found a documented answer.


回答1:


Default notification settings:

Foreground service notification:

Disable notifications:

Android 8 shows this notification after few seconds (when you send your application to background):



来源:https://stackoverflow.com/questions/47678213/android-8-foreground-service-with-notification-channel

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