Alarm Manager wont trigger
<p>I asked a question similar to this yesterday but have changed my code a fair bit and have a different issue now.</p>

<p>I have a toggle button that sets an alarm manager with a pending intent that should trigger after 5 seconds. I have it on a one shot setting, so i want the message to appear once (as later I will be implementing this for a date value).</p>

<p>I get no errors with this code, but I cant seem to trigger my intent that then shows my toast message.</p>

<p>Here's how I have defined the activity of the 'DateAlarm' class in the xml:</p>

<pre><code>     &lt;activity
        android:name=".DateAlarm"
        android:label="@string/app_name" &gt;
        &lt;intent-filter&gt;
            &lt;action android:name="com.example.flybase2.DateAlarm" /&gt;
            &lt;category android:name="android.intent.category.DEFAULT" /&gt;
        &lt;/intent-filter&gt;
    &lt;/activity&gt;
</code></pre>

<p>Heres my my toggle button onClick method for my toggle button with the alarm manager:</p>

<pre><code>case (R.id.toggleButton1):

    Integer dobMonth = setDate.getMonth();
    Integer dobYear = setDate.getYear();
    Integer dobDate = setDate.getDayOfMonth();

    Date set;
    set = new Date(dobYear - 1900, dobMonth, dobDate);


    AlarmManager am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
    Intent intent = new Intent(this, DateAlarm.class);
    PendingIntent pendingIntent = PendingIntent.getService(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);
    am.set(AlarmManager.RTC_WAKEUP,System.currentTimeMillis() + (5 * 1000), pendingIntent); 


    break;
</code></pre>

<p>And my final 'DateAlarm' class that holds the action of the intent.</p>

<pre><code>package com.example.flybase2;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.widget.Toast;

public class DateAlarm extends Activity {

Context context;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

     Toast.makeText(context, "Appointment is today", Toast.LENGTH_LONG).show();
}
</code></pre>

<p>}</p>
