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?
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!