2

I have this media player project and I have foreground service in it which allows me to control the song through notifications even if I clear the app in the background. Everything is working fine including the controls in the notification. But...the notification just remains forever and cannot be cleared even if I try to clear it until I re-run the app or restart my phone. Please help. Tried things like setAutoCancel(true) and etc

sonali
  • 762
  • 10
  • 23
Sam
  • 21
  • 1

1 Answers1

1

Are you calling

stopForeground()

?

This method takes a Boolean to indicate if you want to remove the notification as well.

Read this article

Agustin
  • 67
  • 9
  • No ive just used startForeground() – Sam Jan 31 '21 at 07:46
  • When i used stop foreground.. the play pause buttons jn my notification stopped working – Sam Jan 31 '21 at 07:47
  • Please post your relevant code with comments, along with editing your post to include what you have already tried, and screenshots or videos of your current situation – Agustin Feb 01 '21 at 13:18
  • Also, if you already solved your problem and my answer helped you out, please mark it as Correct :) – Agustin Feb 01 '21 at 19:23