si.initialize2 no sound

fifiddu70

Well-Known Member
Licensed User
Longtime User
if I use si.initialize2 and Use notification1.sound = true
I can not hear the ringer.
because it does not work?
I would make the phone ring arrival of text messages, and disable the alarm when I want, I'll post my code
B4X:
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.
   
    Dim notification1 As Notification
    Dim SI As SmsInterceptor
   End Sub

Sub Service_Create
   SI.Initialize2("SI",999)
   
End Sub

Sub Service_Start (StartingIntent As Intent)
   
StartServiceAt("", DateTime.Now + 0.1 * DateTime.TicksPerMinute, False)
   
End Sub

Sub Service_Destroy

End Sub

Sub SI_MessageReceived (From As String, Body As String) As Boolean
    ToastMessageShow(From, True)
   If Body = "On" Then
   notification1.Initialize
   notification1.Icon = "icon"
   notification1.Vibrate = True
   notification1.Sound = True
   notification1.AutoCancel = True
   End If
   If Body = "Off" Then
   notification1.Initialize
   notification1.Icon = "icon"
   notification1.Vibrate = False
   notification1.Sound = False
   notification1.AutoCancel = False
   End If
   Return True
End Sub
 
Top