Hi Team,
I'm trying to set up an alarm that will repeat every 7 days based on this example:
www.b4x.com
Is this code correct? thanks in advance
Edit: What is needed to repeatthis alarm every 7 days?
I'm trying to set up an alarm that will repeat every 7 days based on this example:
Start receiver at exact time
The standard StartReceiverAt is inexact, in order to allow the OS to make optimizations. Worth reading: https://developer.android.com/training/scheduling/alarms Exact scheduling: 1. AddPermission(android.permission.SCHEDULE_EXACT_ALARM) 2. Private ion As Object - class global 3. Private...
![www.b4x.com](/android/forum/proxy.php?image=https%3A%2F%2Fwww.b4x.com%2Fandroid%2Fforum%2Ffavicon-32x32.png&hash=bcf22ccc379ea83798b29b214de4d482&return_error=1)
Is this code correct? thanks in advance
B4X:
Private Sub Button2_Click
Wait For (GetScheduleExactAlarmPermission) Complete (HasPermission As Boolean)
if HasPermission Then
StartServiceAtExact(ScheduledReceiver, DateTime.Now + 7 * DateTime.TicksPerDay, True) ' Schedule for 7 days later
Else
Log("no permission")
End If
End Sub
Edit: What is needed to repeatthis alarm every 7 days?
Last edited: