Repeating Local Notifications Automatically?
Solution 1:
"is there any way to get the current activated ALARM SERVICE ? (how?)" Long story short, No you can't directly from Android (you can do it with the shell, while debugging OR if you have rooted your device, in this case, yes).
BUT, good news: an alarm is fully defined by its pending intent, hence, same pending intent, same alarm. What you can do is to call your alarm each time you open the main activity with the same EXACT pending intent. at this point you have 2 choice about the flag of the pendin intent: you can use PendingIntent.FLAG_CANCEL_CURRENT or PendingIntent.FLAG_UPDATE_CURRENT.
The first one will get lunched with the alarm and, if there's one corresponding pending intet allready registered, will simply do nothing (cancell the request leaving the current one)
The second one will get lunched with the alarm and, if there's one corresponding pending intent already registered, will update the present alarm and won't add a ton of alarms each time you open your app.
Personally, the second one has always done his job for me
(see https://developer.android.com/reference/android/app/PendingIntent.html)
Post a Comment for "Repeating Local Notifications Automatically?"