Android的startForeground前台Service如何去掉通知显示

2024-12-25 08:44:29
推荐回答(1个)
回答1:

设置成前台的service一般的清理软件就杀不掉service了~~//forsetthisserviceasforegroundservice,SERVICE_STATUSisintvalueNotificationstatus=newNotification();status.flags|=Notification.FLAG_FOREGROUND_SERVICE;startForeground(SERVICE_STATUS,status);