O ozofnash New Member Mar 17, 2020 #1 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: Copy 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
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: Copy 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
Erel B4X founder Staff member Licensed User Longtime User Mar 17, 2020 #2 The code looks correct. Add a log message. Maybe it is not called? Upvote 0
O ozofnash New Member Mar 17, 2020 #3 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
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?
Erel B4X founder Staff member Licensed User Longtime User Mar 17, 2020 #4 ozofnash said: did find an occasional unhandled exception in the sub calling the PlaySound, think that would cause things to fail afterwards? Click to expand... How can we help you if you don't provide enough information??? Upvote 0
ozofnash said: did find an occasional unhandled exception in the sub calling the PlaySound, think that would cause things to fail afterwards? Click to expand... How can we help you if you don't provide enough information???