startForeground() does not show my Notification

后端 未结 6 640
悲哀的现实
悲哀的现实 2020-12-08 18:58

I am trying to make my Service running in foreground. I tried to use this example (please look for the section \"Running a Service in the Foreground\")

6条回答
  •  情歌与酒
    2020-12-08 19:21

    This might be an old thread, but I'd like to add what I just learned which is not mentioned yet:

    It is possible that a Service is still alive after stopSelf() is called because there are Activity that have bound to the Service. As a matter of fact, the startForeground() is just not going to show the notification nor giving any exception in this circumstance.

提交回复
热议问题