If I don't it gives me the following day for some reason.

 

From: [email protected]
[mailto:[email protected]] On Behalf Of Nobu Games
Sent: Monday, July 02, 2012 6:43 PM
To: [email protected]
Subject: Re: [android-developers] Re: AlarmManager not waiting to fire off
alarm...

 

Ok... another thing I just noticed:

You are subtracting 1 day from your day of month, which would yield a date
in the past. Is there a reason for that line of code:

cal.set(Calendar.DAY_OF_MONTH, dpEvent.getDayOfMonth()-1);

Maybe you confused that with the month. Months have the offset 0, not day of
month.

On Monday, July 2, 2012 5:31:32 PM UTC-5, Tommy wrote:

tpAddEvent.getCurrentHour() returns 24 hour format.

 

I updated Calendar.HOUR to Calendar.HOUR_OF_DAY but I have the same issue

 

From: [email protected]
[mailto:[email protected]] On Behalf Of Nobu Games
Sent: Monday, July 02, 2012 5:51 PM
To: [email protected]
Subject: [android-developers] Re: AlarmManager not waiting to fire off
alarm...

 

Just an educated guess. The documentation about the get method states, that
alarm dates in the past will be triggered immediately, which is your case.

Following line might be the problem because of a possibly wrong 12 / 24 hour
conversion:

   cal.set(Calendar.HOUR, tpAddEvent.getCurrentHour());

What does tpAddEvent return? Is it in "hour of day" format? Then you need to
rewrite the line to

   cal.set(Calendar.HOUR_OF_DAY, tpAddEvent.getCurrentHour());

If it is in 12 hour format, then you must also set AM/PM on your calendar:

   cal.set(Calendar.AM_PM, tpAddEvent.isAM() ? Calendar.AM : Calendar.PM);

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to