I am not sure what happen... all i know is i haven't changed the code in over a year. I install the apk from a year ago and the notifications show up. When I compile the program again with the latest version of B4A the Service Notifications don't work. I hear the sound and it vibrates but nothing under notifications.
Here is my Service Code, I haven't changed it since last year. So it should be fine. Has something changed with B4A?
Here is my Service Code, I haven't changed it since last year. So it should be fine. Has something changed with B4A?
B4X:
Sub Process_Globals
Dim p As Phone
Dim pw As PhoneWakeState
Dim SayThis As String
Dim ReSec As Int
Dim EndSec As Int
Dim ReminderOn As Boolean
Dim TimeStarted As String
Dim DateStarted As String
Dim ReminderPause As Boolean
Dim VoiceInt As Int
Dim VibrateInt As Int
Dim SoundInt As Int
Dim ReHoursInt As Int
Dim ReMinInt As Int
Dim EndHoursInt As Int
Dim EndMinInt As Int
Dim Status As String
Status = "Stopped"
Dim n As Notification
Dim Test As Boolean
ReminderOn = False
ReminderPause= False
EndMinInt = 2
ReMinInt = 1
SoundInt = 1
End Sub
Sub Service_Create
End Sub
Sub Service_Start (StartingIntent As Intent)
pw.PartialLock
n.Initialize
n.Icon = "sicon"
n.SetInfo("Procrastinator", "Reminder: " & SayThis , Main)
n.Sound = False
n.Light = True
Select VibrateInt
Case 0
n.Vibrate = True
Case 1
n.Vibrate = False
End Select
Select SoundInt
Case 0
n.sound = True
Case 1
n.sound = False
End Select
If ReminderPause = True Then
PhoneState.Resume = True
'ToastMessageShow ("Phone is being used. Reminder Pasued!",True)
Return True
End If
If ReminderOn = True Then
Service.StartForeground (2, n)
If VoiceInt = 0 Then Main.TTS1.Speak (SayThis,True)
StartServiceAt("", DateTime.Now + ReSec * 1000, True)
Else
n.SetInfo("Procrastinator", "Stopped" , Main)
If VoiceInt = 0 Then Main.TTS1.Speak ("Your reminder has stopped.",True)
Status = "Stopped"
pw.ReleasePartialLock
CallSub(Main,"Stop")
Service.StopForeground (1)
End If
End Sub
Sub Service_Destroy
End Sub