如何在notifications中实现恢复activity,而不是开启一个新的activity?
long when = System.currentTimeMillis(); Notification notification = new Notification(R.drawable.mark,"", when); notification.flags |= Notification.FLAG_NO_CLEAR|Notification.FLAG_ONGOING_EVENT; Intent notificationIntent = new Intent(Intent.ACTION_MAIN); notificationIntent.setClass(this, MainActivity.class); notificationIntent.addCategory(Intent.CATEGORY_HOME); notificationIntent.addFlags(Intent.action_) notificationIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent contentIntent = PendingIntent.getActivity(this,1, notificationIntent,PendingIntent.FLAG_UPDATE_CURRENT); notification.setLatestEventInfo(this,getResources().getString(R.string.app_name),"xxxxxx",contentIntent); mNotificationManager.notify(R.drawable.mark, notification);