Question about alarm manager I have this code
Calendar cal = Calendar.getInstance();
cal.add(Calendar.SECOND, 5);
Integer prof=t.getProfile();
String prof2=prof.toString();
Intent intent = new Intent(this, AlarmActivity.class);
intent.putExtra("prof",(String)prof2);
PendingIntent pendingIntent = PendingIntent.getActivity(this,(int)t.getId(), intent, PendingIntent.FLAG_CANCEL_CURRENT);
AlarmManager am =
(AlarmManager)getSystemService(Activity.ALARM_SERVICE);
am.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(),
pendingIntent);
Its unfinished yet... I know I can set time of the calendar with cal.set(Calendar.MINUTES,minutes); and same for hours..
But how do I set day? For example - monday? day_of_week sets it? If so - range is 0-6 or 1-7? And lowest value is monday or sunday?
Also, if Im going to make repeating event (once a week) - should I make new calendar and set day of week/hours/minutes? or should I user getInstance() and change hour/min/day of week?
About alarm manager. When u make an alarm, you give request_code which should be uniq. If I reboot my phone - does all the request codes stay in alarm manager on phone? If no - how to make they stay... If yes - how do I delete unnecesery made ones while testing?