Android Question Alarm Date Problem

Ertan

Active Member
Licensed User
Hello,

I have been investigating the cause of this error for a long time.
Since I could not find the solution, I decided to open a topic here.,
I found an alarm system, downloaded it from the forum.

I choose the date of 2020 and set the alarm, no problem.
I choose the date of 2021 and set the alarm, no problem.
but I choose the date of 2022 and set an alarm, a problem occurs and the alarm starts to ring.
2024,2025 date problem.
I am sure that the solution to this problem is simple, but I could not find it.

I leave the example here. Maybe there is someone who will need it. My benefit touches :)
Can you help me solve it?
 

Attachments

  • alarm.zip
    240.7 KB · Views: 105

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. You should use B4XDialog with B4XDateTemplate.
2. Why is Alarm set to be string? It should be Long
3. All of these calculations are not needed.

You should replace them with:
B4X:
StartServiceAt(AlarmService, (Alarm, True)

Scheduled services are removed when the device is restarted. It is a bit optimistic to expect the device to keep running until 2025.
 
Upvote 0

Ertan

Active Member
Licensed User
1. You should use B4XDialog with B4XDateTemplate.
2. Why is Alarm set to be string? It should be Long
3. All of these calculations are not needed.

You should replace them with:
B4X:
StartServiceAt(AlarmService, (Alarm, True)

Scheduled services are removed when the device is restarted. It is a bit optimistic to expect the device to keep running until 2025.
You are right. What solution is there for the reminder to continue until 2025 when the device restarts?
 
Upvote 0

Ertan

Active Member
Licensed User
Store the scheduled time in a file, create a service that starts at boot and reschedule the service.
Thanks.
B4X:
StartServiceAt(AlarmService, (Alarm, True)
Invalid number of parentheses.
I get an error. I tried all the ways but it didn't. Can you help me in the project?
 
Upvote 0
Top