Using AlarmManager in Android to launch a daily service?
<p>I need to run a service each night at midnight. I would like to use the AlarmManager to do this.</p>

<p>Can you give me some guidance of how to make it work correctly?</p>

<pre><code>alarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
alarmManager.setInexactRepeating(AlarmManager.ELAPSED_REALTIME, System.currentTimeMillis(), AlarmManager.INTERNAL_DAY, serviceIntent);
</code></pre>

<p>Perhaps I need to use a Calendar object to specify the time? Thanks for any help!</p>
