Hello I would like to create a basic but fully working alarm clock application just to increase my android programming skills but it has too many bug I have to rewrite it from scratch.
A pending intent that fires when the alarm is triggered. When you set a second alarm that uses the same pending intent, it replaces the original alarm.
What I did is whenever user creates new alarm i add new alarm to alarm SQLite table and even if the alarm repeats every day in week I use the lastInsertId
of that alarm as unique id for my pending intent and it means 7 pending intens has the same ids...
A trigger time. If the trigger time you specify is in the past, the alarm triggers immediately.
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
calendar.set(Calendar.HOUR_OF_DAY, 8);
calendar.set(Calendar.MINUTE, 30);
calendar.set(Calendar.DAY_OF_WEEK,1);
alarmMgr.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),
AlarmManager.INTERVAL_DAY * 7, alarmIntent);
Even if I hardcode the values it always triggers immediately, since the Monday has passed what do I need to do?