假设我完全相当我的应用程序。(没有更多的活动堆栈)
但是,通知到达,用户将在单击时导航到第二个活动
问题是我怎样才能让第二个活动回到第一个活动(lancher)然后退出
如果按下后退按钮而不是直接退出(因为它没有任何堆栈)!?
导航到第二幕的通知。
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_stat_social_person)
.setContentTitle("AIR° TRACKING MODE!")
.setStyle(new NotificationCompat.BigTextStyle()
.bigText(msg))
.setContentText(msg)
.setLights(Color.BLUE, 500, 500)
.setDefaults(Notification.DEFAULT_ALL)
.setOngoing(true);
PendingIntent contentIntent = PendingIntent.getActivity(
this,
0,
new Intent(this, Activity_Second.class).addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT),
PendingIntent.FLAG_UPDATE_CURRENT);
mBuilder.setContentIntent(contentIntent);
mNotificationManager.notify(GM.NOTIFICATION_TRACKING_MODE, mBuilder.build());
}