Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Can't close Notification


Currently I am developing an App, which plays Audio (also in Background).

[ using Xamarin Forms PCL and a Plugin "MediaManager" (with "MediaManager.Forms" etc.) ]

That Plugin supports an Implementation of a "Notification-Manager", which displays the current title, band etc. and you can play, pause, skip...

If I start playing a track, this Notification Manager shows the notification and works fine.
But at the moment you close the app (while the track is playing) the track stops playing, but the notification stays.

Also you cant close the notification or press play pause.
The only thing you can do is click on the whole notification to get back to the app (it starts a new instance of the app)

My thoughts so far:

So far I figured out how to close that notification via code.
But there is no callback when the Android-App is closed (only when going in background).

~~Android has a class "MainApplication" with "OnTerminate" which sounds like something that could work - but it doesn't get called.
    (Just like OnDestroy in MainActivity or Dispose() with IDispose anywhere.)

(is there any event or smth. that I can use when the app gets closed?)

Is there a way to say "user is always able to dismiss notification"?


Sign In or Register to comment.