title: How to update notification without affecting the pending intent and its payload?
body: <p>I am creating a notification using the below code:</p>
  
  <pre><code>Intent intent = new Intent(this, GetStockQuote.class);
              intent.putExtra("abc", abcObject);
              intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
              PendingIntent pIntent = PendingIntent.getActivity(this, 0, intent, 0);
  
              /* Build the notification */
              Notification notification = new Notification.Builder(this)
                                       .setContentTitle(abcObject.getCode())
                                       .setContentText(abcObject.getText())
                                       .setAutoCancel(false)
                                       .setSmallIcon(R.drawable.ic_launcher)
                                       .setContentIntent(pIntent).build();
   NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
              notificationManager.notify(notificationID,notification);
              Log.i(TAG,"notification.notified");
  </code></pre>
  
  <p>As you can see the <code>PendingIntent</code> attached to the notification carries a payload. It's an object of a custom class.</p>
  
  <p>Now I update the notification in a service. I understand that if you have to update a notification (without creating a new one), you have to specify the same <code>notificationID</code> which I am doing.</p>
  
  <p>This is the code in the service used to update the notification that was created above:</p>
  
  <pre><code>Intent intent = new Intent(this, GetStockQuote.class);
                  PendingIntent pIntent = PendingIntent.getActivity(this, 0, intent, 0);   
   Notification notification=new Notification.Builder(this)
                                  .setContentTitle(newTitle)
                                  .setContentText(newBody)
                                  .setSmallIcon(R.drawable.ic_launcher)
                                  .setContentIntent(pIntent)
                                  .build();
  
                  /*Get instance of Notification Manager and show the notification*/
                          NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
                          notificationManager.notify(notificationID,notification);
  </code></pre>
  
  <p>The code updates the existing notification with the new content, but the <code>PendingIntent</code> does not contain the payload.</p>
  
  <p>I don't have access to the payload in the service. So, I would like to just update the notification service with it's new <code>textContent</code> without affecting the payload that was set during this creation.</p>
  
  <p>Now the problem is I have many such notifications. Each of them has a unique payload but the destination class in the <code>Intent</code> remains the same.</p>
  
  <p>Is there a way to retain the payload when updating a notification?</p>