当我通过我的应用程序触摸通知时,运行onResume()和onCreate() 我的应用程序只有一个活动。我需要的是在应用程序运行时运行onResume(),如果没有运行则运行onCreate()
Intent intentNot = new Intent(this, OfflineActivity.class);
Notification notification = new Notification(R.drawable.icon, "Title", System.currentTimeMillis());
notification.setLatestEventInfo(this, "Title", "Text" , PendingIntent.getActivity(this.getBaseContext(), 0, intentNot, PendingIntent.FLAG_UPDATE_CURRENT));
intentNot.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_SINGLE_TOP);
notification.defaults |= Notification.DEFAULT_VIBRATE;
notification.defaults |= Notification.DEFAULT_SOUND;
notification.defaults |= Notification.DEFAULT_LIGHTS;
mManager.notify(APP_ID_NOTIFICATION, notification);