How to run a background service in Oreo for longer period?

后端 未结 4 737
滥情空心
滥情空心 2020-12-03 15:39

Android Oreo has imposed many restrictions on running background service. Services now don\'t behave like normal in Oreo as they used to before.

But what if I have t

4条回答
  •  醉话见心
    2020-12-03 16:11

    I discovered that we can run forground service without showing notification for android oreo and above, here is the solution first create notification with notification Channel also set channel id for notifications then start forground service with notification. now it's time to cancel notification Channel with id after 1 or 2 second that's means the notification will remove and the service will run alwayes . that's all

提交回复
热议问题