If the current day of week is > Sunday, your code moves the calendar
back in time, to most recent Sunday before now.

Add a check for this case, and move the calendar forward one week if needed.

5 декабря 2011 г. 16:19 пользователь Hassy <[email protected]> написал:
> I'm creating an alarm application and I already created the basic
> alarm activity
> and receiver class.now I want to repeat the alarm on specific day of
> week.
>
> I set DAY_OF_WEEK to 1 to set the alarm repeat on sunday but it
> doesn't work.
>
>  Calendar calendar = Calendar.getInstance()
>  calendar.set(calendar.DAY_OF_WEEK, 1);
>  calendar.set(calendar.HOUR_OF_DAY, sHour);
>  calendar.set(calendar.MINUTE, sMin);
>  calendar.set(calendar.SECOND, 0);
>  calendar.set(calendar.MILLISECOND, 0);
>
> Please tell me how to set the alam on specific day.
>
>
> Thank you
> Hassy
>
> --
> 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