📜  停止前台服务 - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:42.404000             🧑  作者: Mango

代码示例1
stopForeground(true)
stopSelf()
closenotification()


private fun closeNotification(){
val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
notificationManager.cancelAll()
}