Do not call alarmManager.cancel with null intent

This commit is contained in:
Jindřich Makovička 2016-10-24 07:18:57 +02:00
parent e925180201
commit 44e34dd946

View file

@ -196,9 +196,13 @@ public class NavigationService extends Service implements LocationListener {
lock.release();
}
}
// remove alarm
AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
alarmManager.cancel(pendingIntent);
if (pendingIntent != null) {
// remove alarm
AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
alarmManager.cancel(pendingIntent);
}
// remove notification
stopForeground(Boolean.TRUE);
app.runInUIThread(new Runnable() {