Thank you for your reply but cal.getTimeInMillis() returns the right thing. It has been suggested before that this might be returning the wrong value but whenever I attach my device via USB cable I always see all alarms being set as you can see one of them below (others omitted). I regret that I cannot see the timestamp on the logcat output (where is the date and time)? How long does the logcat go back in time? I need to disconnect the device and then look at the logcat several hours later when an alarm is missed, but with no timestamp it is a little difficult to go back to the place in the log where the messages were supposed to be and debug. Could it be that my LG Optimus Net is one of few devices where the alarm does not worked as advertised in the API? What other devices may have this same problem?
Thanks, John Goche D/AlarmExpired(22715): <!>com.fobar.app.AlarmExpiredActivity 35<!> Calling alarm setter... D/AlarmSetter(22715): <!>com.fobar.app.AlarmSetter 2459<!> doSetupAlarm called. D/AlarmSetter(22715): <!>com.fobar.app.AlarmSetter 2470<!> groupsDateTimes.size() is : 1 I/doSetupAlarm(22715): <!>com.fobar.app.AlarmSetter 2506<!> Setting alarm for group: ??????? D/AlarmSetter(22715): <!>com.fobar.app.AlarmSetter 2528<!> Cancelling alarm... D/AlarmSetter(22715): <!>com.fobar.app.AlarmSetter 2532<!> Done cancelling alarm. D/AlarmSetter(22715): <!>com.fobar.app.AlarmSetter 2549<!> Setting alarm... D/AlarmSetter(22715): <!>com.fobar.app.AlarmSetter 2559<!> Done setting alarm. On Sun, Oct 23, 2011 at 12:03 PM, Ali Chousein <ali.chous...@gmail.com>wrote: > What does cal.getTimeInMillis() in the following statement return? > Maybe the problem is there. > alarmManager.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), > pendingIntent); > > I use the following statement while setting alarms: > this.am.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, > SystemClock.elapsedRealtime()+tOffset, pendingIntent); > > where SystemClock.elapsedRealtime() is the elapsed time in > milliseconds since the system was booted, including deep sleep. > "tOffset" is the milliseconds which should elapse before the alarm is > fired. > > ------------------------------------------------- > Ali Chousein > Weather-Buddy > http://weatherbuddy.blogspot.com/ | http://twitter.com/weather_buddy > Geo-Filtered Assistant > http://geo-filtered-assistant.blogspot.com/ > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en