I got null pointer exception when try to implement a sample code from here. I have some confusing about the sample code there in "Start the alarm when the device boots" section in point 2 and point 3. Here are my main class to trigger the alarm and my broadcast receiver class to receive the broadcast and trigger an action, and my manifest file. My logcat null pointer exception error point to the if block statement in broadcast receiver class. My question is :
Change:
if(intent.getAction().equals("android.intent.action.BOOT_COMPLETED"))
to:
if("android.intent.action.BOOT_COMPLETED".equals(intent.getAction()))
so it handles null
action strings properly. That should clear up the crash that you are experiencing.