Clicking on Notification is not starting intended activity?

后端 未结 7 1736
野性不改
野性不改 2020-11-30 09:32

I am using GCM in my application and also using NotificationManager to Create a Notification whenever GCM message is received.Till now everything is working perfectly and GC

7条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-30 10:19

    My problem got solved I just have to add PendingIntent.FLAG_ONE_SHOT flag as well , so I replaced :

    PendingIntent contentIntent = stackBuilder
                    .getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
    

    to

    PendingIntent contentIntent = stackBuilder
                    .getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT
                            | PendingIntent.FLAG_ONE_SHOT);
    

提交回复
热议问题