Alarm Manager and Notifications Android
<p>I am trying to set an alarm manager so my app will send out a notification every Sunday but I can't seem to get it.  Here is my code:</p>

<p>This code is in the onCreate method of a class called "StatusOfChild.java"</p>

<pre><code>Intent myIntent = new Intent(StatusOfChild.this , myService.class);     
    AlarmManager alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);
    PendingIntent pendingIntent = PendingIntent.getService(StatusOfChild.this, 0, myIntent, 0);

    Calendar calendar = Calendar.getInstance();
    calendar.set(Calendar.DAY_OF_WEEK, 1);
    calendar.set(Calendar.HOUR_OF_DAY, 12);
    calendar.set(Calendar.MINUTE, 00);
    calendar.set(Calendar.SECOND, 00);

    alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), 24*60*60*1000 , pendingIntent);  //set repeating every 24 hours
</code></pre>

<p>This code is in a class called "myService.java"</p>

<pre><code>public class myService extends IntentService{

public myService(){
    super("myService");
}


@Override
protected void onHandleIntent(Intent intent) {
    // TODO Auto-generated method stub
    NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
    Notification notify = new Notification(R.drawable.main1,"Its Time to Eat",1000);

    Context context = myService.this;
    CharSequence title = "Its Time to Eat";
    CharSequence details = "Click Here to Search for Restaurants";
    Intent myIntent = new Intent(context,StatusOfChild.class);
    PendingIntent pending = PendingIntent.getActivity(context, 0, myIntent, 0);
    notify.setLatestEventInfo(context, title, details, pending);
    nm.notify(0,notify);
}
</code></pre>

<p>}</p>
