AlarmManager Daily Service

Put your problem here if it does not fit any of the other categories.

AlarmManager Daily Service

Postby atolar » Sun May 30, 2010 7:12 pm

I need to run a service each night at midnight. I would like to use the AlarmManager to do this.

Can you give me some guidance of how to make it work correctly?

Code: Select all
alarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
alarmManager.setInexactRepeating(AlarmManager.ELAPSED_REALTIME, System.currentTimeMillis(), AlarmManager.INTERNAL_DAY, serviceIntent);

Perhaps I need to use a Calendar object to specify the time? Thanks for any help!
Once Poster
Once Poster
Posts: 1
Joined: Thu Mar 18, 2010 7:21 am


Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 10 guests