【发布时间】:2015-06-09 18:42:56
【问题描述】:
目前我正在处理通知。但是当我已经收到通知并且我在通知栏上单击了此通知时,我不必打开新活动。但我必须打开最近的活动。当一些数据保存在我最近的应用程序和在后台运行的应用程序并接收通知时,然后使用挂起的意图活动以onresume/oncrete 开头。但是我上次活动保存的数据已经丢失。因此,单击通知时的任何解决方案都不必重新启动活动。
请给我一些解决方案。
提前致谢。
【问题讨论】:
-
你好,我已经使用 set intent to setflags 解决了我的问题。
Intent notificationIntent = null; notificationIntent = new Intent(mActivity, conductpd.class); notificationIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); notificationIntent.putExtra("MessageSender", chatHistory.getFromName()); -
你可以回答你的问题并接受它:)
-
表示你自己解决了这个问题..?
-
是的..我自己解决了我的问题。
-
@dipali...太好了....恭喜...!!
标签: android android-intent notifications android-pendingintent