Android 总是通知 return 我以前的捆绑包数据

Android notification always return me previous bundle data

我正在尝试获取有关我收到的每个推送通知的新数据, 我在每个新的推送通知中传递新数据,然后将这些数据添加到包中并将其传递给我的 activity, 每次我发送推送通知时都会出现这个问题,我的 activity 总是使用捆绑包中的先前数据。

这是我的代码,

Intent notificationIntent = new Intent(context, Myactivity.class);
        Bundle b = new Bundle();
        b.putString("post_id", newsletter_key);
        b.putString("newsletter_title", message);
        notificationIntent.putExtra("bundle_push", b);

        //notificationIntent.putExtra("NotificationMessage", newsletter_key.toString());

        notificationIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
       // notificationIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
        // set intent so it does not start a new activity



        PendingIntent intent =
                PendingIntent.getActivity(context, 0, notificationIntent, 0);


                notification.setLatestEventInfo(context, title, message, intent);
        notification.flags |= Notification.FLAG_AUTO_CANCEL;

        // Play default notification sound
        notification.defaults |= Notification.DEFAULT_SOUND;

        //notification.sound = Uri.parse("android.resource://" + context.getPackageName() + "your_sound_file_name.mp3");

        // Vibrate if vibrate is enabled
        notification.defaults |= Notification.DEFAULT_VIBRATE;
        notificationManager.notify(0, notification);

有什么帮助吗? 提前致谢。

用下面的代码替换 PendingIntent

PendingIntent intent= PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);

参考 - http://developer.android.com/reference/android/app/PendingIntent.html