点击通知启动app

service发送通知,收到通知后在通知栏点击打开app。

 

点击通知后通知消失:

Notification.Builder.setAutoCancel(true);

 

app打开时点击通知出现重复的Acitivity,修改启动模式:

http://wangkuiwu.github.io/2014/06/26/IntentFlag/

http://stackoverflow.com/questions/2326622/starting-activity-through-notification-avoiding-duplicate-activities

notification-avoiding-duplicate-activities

intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);

android:launchMode="singleInstance"

 

posted @ 2016-09-29 16:00  qike  阅读(680)  评论(0编辑  收藏  举报