Re: [android-developers] setting alarm

calendar.set(Calendar.HOUR_OF_DAY,1);
calendar.set(Calendar.MINUTE,12);

This is 1:12am, not 8am.

Also:

-- Use Calendar.getInstance()
-- Do not forget that if it is after 1:12am today (which is to say,
the bulk of the day), this time will be in the past

On Sat, Apr 2, 2011 at 3:57 PM, niju <neerajmurali@gmail.com> wrote:
> Hi,
>
> i am facing issues for  setting alarm through android code.
> I  gone through  most of the documents  on net  about alarmmanager and
> how to use it but  nothing worked.
>
> please  find  the code am using  ,is it the right way for  setting
> alarm .
> i  am setting it for  8 AM morning .but  its not  working  i am
> strugling on it for 3 hrs.
> i am testing it on emulator.
> :(
> Calendar calendar = new GregorianCalendar(); or // Calendar calendar =
> new Calendar();
>  calendar.set(Calendar.HOUR_OF_DAY,1);
> calendar.set(Calendar.MINUTE,12);
>  calendar.set(Calendar.SECOND, 0);
>  alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),
> pendingIntent);
>
> Thank  you
>
> --
> 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+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to *Advanced* Android Development_ Version
1.9.2 Available!

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en