Ok so after browsing the web for hours I am completely confused as to how to implement an alarm manager that repeats a method called TemperatureCatch() from an activity called Locator(). I've tried a bunch of sites an stack overflow threads and they all confuse me. I have a toggle button that turns the alarm manager on and off. The alarm manager simply repeats a task every set interval in milliseconds even when the app is in the background, and will pull the user back to the app to enter text when the method is executed. What I can understand so far is that I need a service class and a Broadcast receiver class. the only problem I dont know where all my code references go.
Asked
Active
Viewed 157 times
1 Answers
1
You can try this :
alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), 15*1000, pendingIntent);
as explained in this question, this alarm will fire every 15 secondes until you stop it

Community
- 1
- 1

Kevin Gilles
- 463
- 1
- 8
- 23