Sunday, November 20, 2016

Activity does not have the latest intent information put in the pending intent extras

It happens when the activity is resumed.

You need to:

1. In the intent:
  PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent,

  If you have more then one notification at a time, set the request code uniquely

  PendingIntent pendingIntent = PendingIntent.getActivity(this, uniqueIntForName, intent, PendingIntent.FLAG_UPDATE_CURRENT);

  This way you will have the correct extras for the specific notification when lunching the 

2. In the Activity the pending intent is calling:

   public void onNewIntent(Intent newIntent) {
    Log.i(P.Tag, "===onNewIntent called===");

No comments:

Post a Comment