Skip to content

Instantly share code, notes, and snippets.

@felipecaldas
Created March 14, 2013 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felipecaldas/5161538 to your computer and use it in GitHub Desktop.
Save felipecaldas/5161538 to your computer and use it in GitHub Desktop.
<service
android:name=".NotifyService"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
</service>
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.HOUR, 0);
calendar.set(Calendar.AM_PM, Calendar.AM);
calendar.add(Calendar.DAY_OF_MONTH, 1);
Intent myIntent = new Intent(this , NotifyService.class);
AlarmManager alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);
PendingIntent pendingIntent = PendingIntent.getService(this, 0, myIntent, 0);
alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pendingIntent);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment