Q:

intent in static method is null when passed to pending intent

I'm currently nearly done an app I'm working on, except for a new roadblock.
My app includes a service alarm that fires as intended, the intents within it work at the exact times they're set, and everything else is working fine. However, my app has menu button that lets you turn it on and off. It calls this method in the IntentService to check on whether it should display as "Turn Alarm On" or "Turn Alarm Off", depending on what the boolean value returned is. The user's choice (they want it on or off) is kept in a shared prefs as well, which also save correctly from what my Log statements are telling me. The problem is that when the device is reset, everything in the app works correctly, preferences are saved, EXCEPT this method returns false after the reset when the app is first run, so the menu items don't update correctly. 
On a reset, the menu button says "Turn Alarm On", even if it's actually already on, due to the method below returning false. If I click it once, the Alarm is turned off but the text doesn't change, but the button is working. If I click it a second time, the next changes as intended to "Turn Alarm Off", the alarm is back on, and it then works as intended. Below is the method in question, which when debugged show me that everything in the intent I created is null when it's passed into the PendingIntent, but I can't figure out why.
public static boolean isServiceAlarmOn(Context context)
    {
        Intent i = new Intent(context.getApplicationContext(), CommuteCheckAlarmService.class);
        PendingIntent pi = PendingIntent.getService(context, 0, i, PendingIntent.FLAG_NO_CREATE);
        Log.i(ALARM_SERVICE, "Checking isServiceAlarmOn, pi is NOT null is " + (pi != null) + "and the intent is not null" + (i != null));
        return pi != null;
    }

Does anybody have any idea what's causing this behavior on the device's reset? I'm running it on an emulator, and the preferences to turn off the alarm also save correctly.
UPDATE: Baffling behavior happens specifically when I'm running my app on an emulator via Run As Android Application, rather than just turning on the emulated device and starting the app within the device like a normal user would. Does anybody know why the above behavior specifically happens during Run As Android Application?

A:

When the device reboots or your app is uninstalled, all of its PendingIntents and alarms are deleted. This is normal behaviour.

