Remove setlargeIcon (not used), remove dead code

This commit is contained in:
jacques 2020-12-28 19:35:20 +01:00
parent 3ae3e56ba7
commit e37ace03dd

View file

@ -87,29 +87,15 @@ public class PillDroidJobService extends JobService {
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent,0); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent,0);
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "PillDroid") NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "PillDroid")
.setSmallIcon(R.drawable.ic_pill_alarm) .setSmallIcon(R.drawable.ic_pill_alarm)
.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher_foreground))
.setContentTitle(getString(R.string.app_name)) .setContentTitle(getString(R.string.app_name))
.setContentText(getString(R.string.notification_text)) .setContentText(getString(R.string.notification_text))
.setPriority(NotificationCompat.PRIORITY_DEFAULT) .setPriority(NotificationCompat.PRIORITY_HIGH)
.setContentIntent(pendingIntent) .setContentIntent(pendingIntent)
.setAutoCancel(true); .setAutoCancel(true);
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this); NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this);
int notificationId = 666; int notificationId = 666;
notificationManager.notify(notificationId, builder.build()); notificationManager.notify(notificationId, builder.build());
/*NotificationManager notificationManager = (NotificationManager) getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE);
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.O){
NotificationChannel notificationChannel = new NotificationChannel("123", "Pilldroid", NotificationManager.IMPORTANCE_DEFAULT);
notificationManager.createNotificationChannel(notificationChannel);
}
NotificationCompat.Builder notification = new NotificationCompat.Builder(getApplicationContext(), "123")
.setContentTitle(getString(R.string.app_name))
.setContentText(getString(R.string.notification_text))
.setSmallIcon(R.drawable.ic_pill_alarm);
notificationManager.notify(1, notification.build());
*/
} }
/** /**