0
我正在创建通知并在执行意向服务期间更新通知。服务完成时出现问题,通知也被取消。服务完成时关闭通知
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());
我能做些什么的意图服务完成后保存通知?
在此先感谢。
你使用NotificationManager显示通知? – 0X0nosugar
是的,我正在使用通知管理器来显示通知。 – MarcForn
'setAutoCancel(boolean autoCancel)'在API级别11中添加使此通知在用户触摸时自动解除。 – pskink