具有通知频道的Android 8前台服务

时间:2017-12-06 15:45:10

标签: android service foreground-service notification-channel

我想在Android 8中启动前台服务,我想知道前台服务如何与通知渠道系统兼容。

假设我们启动了前台服务,然后我们立即创建所需的通知并将其分配给通知渠道。突然,用户决定进入系统设置并禁用通知通道。

在这种情况下会发生什么?该服务会成为后台服务吗?它会被杀死吗?我还没有找到记录在案的答案。

1 个答案:

答案 0 :(得分:5)

默认通知设置:

enter image description here

前台服务通知: enter image description here

禁用通知:

enter image description here

Android 8会在几秒钟后(当您将应用程序发送到后台时)显示此通知:

enter image description here

相关问题