Android Question Play sound stops playing

ozofnash

New Member
Android Kitkat
My app plays the default notification sound each time a button is picked. After so many times, the sound stops playing.
This code is in the Starter module

B4X:
Sub Process_Globals
    Dim gDevice As Phone
    Private gPhone As PhoneVibrate
    Dim gRTM As RingtoneManager
    Dim gSound As String
End Sub

Sub PlaySound
    gSound = gRTM.GetDefault(gRTM.TYPE_NOTIFICATION)
    gRTM.Play(gSound)
    gPhone.Vibrate(1000)
End Sub
 

ozofnash

New Member
I had logs between each line... the log after the Play never output when the play failed.
I did find an occasional unhandled exception in the sub calling the PlaySound, think that would cause things to fail afterwards?
 
Upvote 0
Top