for example i want to have an alarm that will fire every sunday at noon…. how would i do this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use the AlarmManager class:
http://developer.android.com/reference/android/app/AlarmManager.html
Use
public void set (int type, long triggerAtTime, PendingIntent operation)to set the time to fire it.Use
void setRepeating(int type, long triggerAtTime, long interval, PendingIntent operation)to schedule a repeating alarm.Here’s a full example. I don’t really remember all the Calendar methods, so I’m sure that part can be streamlined, but this is a start and you can optimize it later: