Когда мое уведомление пропадает, я хочу восстановить действие, которое было помещено в фон, а не начинать новое действие.Я видел некоторые ответы об использовании FLAGS, но я не знаю, как это реализовать
contentIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | INTENT.FLAG_ACTIVITY_SINGLE_TOP);
Где я могу поместить это в мой код?Я пытался, но это не сработало.Пожалуйста, помогите!
ns = Context.NOTIFICATION_SERVICE;
mNotificationManager = (NotificationManager) getSystemService(ns);
icon = R.drawable.icon;
tickerText = "Short Msg";
when = System.currentTimeMillis();
notification = new Notification(icon, tickerText, when);
context = getApplicationContext();
contentTitle = "MyApp";
contentText = "Reopen App";
notification.defaults |= Notification.DEFAULT_SOUND;
notification.defaults |= Notification.DEFAULT_VIBRATE;
notificationIntent = new Intent(this, StartTimer.class);
contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);