I launch notification from Service. Then in case the application crashes, for example, OnDestroy is called, in which I try to remove the notification, but for some reason it remains in the status bar.

How to solve this problem?

  • Those. if not to delete onDestroy, then it works? - Yuriy SPb
  • And show how you create a notification and how do you give it!? - Kirill Stoianov
  • I have a player that works even when the application is minimized. Accordingly, while he plays, the notification should hang. After I click the "last apps" button and swipe it to the side (I finally close it) - the player stops, but onDestroy was already called when I pressed "back". - Aleksey
  • if the application crashes, then onDestroy not called - Vladyslav Matviienko
  • And what then is caused? Maybe in the Application class something? - Alexey

0