Play notification sound just once

I have implemented a notification which plays a sound
Notification.Builder builder = new Notification.Builder (this) .SetSmallIcon (Resource.Drawable.ic_stat_notify_example) .SetAutoCancel (false) .SetSound (uri)
But I want to play the sound just once and not to loop it.
In the documentation of android there was a flag FLAG_ONLY_ALERT_ONCE, but I could not implement it in Xamarin.
Can somebody help me?

Best Answers


  • MohammadBraeiMohammadBraei DEUniversity
    edited April 2014

    If you found it out. For anyone looking for it:
    Notification notification = builder.Notification; notification.Flags |= Android.App.NotificationFlags.OnlyAlertOnce | Android.App.NotificationFlags.AutoCancel; notificationManager.Notify (1, notification);

Sign In or Register to comment.