I wrote BroadcastReceiver for my Alarm app. In the onReceive method, I read Intent.getAction (). It works well in all versions *, except for the SDK version 1.5, where it throws an exception from the null pointer * . I set the action in another action, where I call broadcastReceiver. Please help me with this. Below is a code snippet for receiver classes and activity,
ProfileActivity.java
public static final String STARTALARMACTION = "android.intent.driodaceapps.action.STARTPROFILE"; public static final String STOPALARMACTION = "android.intent.driodaceapps.action.STOPPROFILE"; AlarmManager alarmMan = (AlarmManager) getSystemService(Context.ALARM_SERVICE); Intent startIntent = new Intent(this,AlarmReceiver.class); startIntent.setAction(STARTALARMACTION); Intent stopIntent = new Intent(this,AlarmReceiver.class); stopIntent.setAction(STOPALARMACTION+intentposition);
AlarmReceiver.java
@Override public void onReceive(Context context,Intent intent){ String intentAction = intent.getAction(); Log.d(TAG,"Intent:"+intentAction); **
After receiving the error, I tried my luck by following the steps in the .manifest file. But to no avail.
Please help me.
Thanks.
android
poddroid
source share