I am new to Android. Here, I am not getting any errors ,While debugging the stopAlarm() method debugger crossed all the lines but the AlarmReceiver is not get called .
can anyone help me to fix it .
Update :
AlarmActivity.java
public void stopAlarm(Context context) {
Intent intent = new Intent(context,AlarmReceiver.class);
intent.setAction("ALARM_OFF");
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, mAlarmId, intent,0);
AlarmManager alarmManager = (AlarmManager) context.getSystemService(ALARM_SERVICE);
alarmManager.cancel(pendingIntent);
}
NullPointerException
in it gets flagged a duplicate of the post Raj linked. – DenominationalismalarmActivity
inWakeupScreen
? Add the code to your original post (edit it please). – Modestine