I'm creating a notification and updating it during the execution of an intent service. The problem appears when the services finished, also the notification is canceled.
intentNotification = new Intent(this, ScanProcessActivity.class);
intentNotification.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mBuilder = new NotificationCompat.Builder(getApplicationContext());
mBuilder.setSmallIcon(R.mipmap.ic_app)
.setAutoCancel(true)
.setOngoing(true)
.setContentTitle("Title")
.setContentText("text")
.setWhen(System.currentTimeMillis());
What can I do to preserve the notification after the Intent Service is finished?
Thanks in advance.