Change pendingIntent flag according to IDE suggestion

This commit is contained in:
jacques 2021-12-28 15:03:38 +01:00
parent 63f68b0db8
commit 14fa50b395

View file

@ -65,7 +65,7 @@ public class AlarmReceiver extends BroadcastReceiver {
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_SINGLE_TOP); | Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_IMMUTABLE);
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, "PillDroid") NotificationCompat.Builder builder = new NotificationCompat.Builder(context, "PillDroid")
.setSmallIcon(R.drawable.ic_pill_alarm) .setSmallIcon(R.drawable.ic_pill_alarm)
@ -139,7 +139,7 @@ public class AlarmReceiver extends BroadcastReceiver {
PendingIntent alarmIntent; PendingIntent alarmIntent;
Intent intent = new Intent(context, AlarmReceiver.class); Intent intent = new Intent(context, AlarmReceiver.class);
alarmIntent = PendingIntent.getBroadcast(context, 0, intent, 0); alarmIntent = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);