当应用程序从最近的应用程序中删除时,我的活动会丢失其通知的跟踪 我的通知代码:
builder = new NotificationCompat.Builder(this).setContentTitle("Started").setSmallIcon(R.drawable.ic_launcher);
targetIntent = new Intent(getApplicationContext(), MainActivity.class);
targetIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
contentIntent = PendingIntent.getActivity(this, 0, targetIntent, PendingIntent.FLAG_CANCEL_CURRENT);
builder.setContentIntent(contentIntent);
notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(1234, builder.build());
我必须在此之后重新启动应用,并且通知不会再打开活动。
这方面的任何线索???