I tried the solution from XXX and while it did initially work, at some point it stopped working. The onReceive never got called again. I spent hours trying to figure out what it could be. What I came to realize is that the Intent for whatever mysterious reason was no longer being called. To get around this, I discovered that you really do need to specify an action for the receiver in the manifest. Example:
Note that the name is ".Alarm" with the period. In XXX's SetAlarm method, create the Intent as follows:
Intent i =newIntent("mypackage.START_ALARM");
The START_ALARM message can be whatever you want it to be. I just gave it that name for demonstration purposes.
I have not seen receivers defined in the manifest without an intent filter that specifies the action. Creating them the way XXX has specified it seems kind of bogus. By specifying the action name, Android will be forced to create an instance of the BroadcastReceiver using the class that corresponds to the action. If you rely upon context, be aware that Android has several different objects that are ALL called context and may not result in getting your BroadcastReceiver created. Forcing Android to create an instance of your class using only the action message is far better than relying upon some iffy context that may never work.