Skip to content Skip to sidebar Skip to footer

Intent Extras Not Received

I am showing a notification from a library attached to my project, when clicked on the notification, the notification takes to an Activity (ReceivingActivity). Activity opens after

Solution 1:

Make sure the PendingIntent is actually passing the data when it's called. See this answer for an explanation: https://stackoverflow.com/a/3851414/1426565

For anyone else, if you're positive the intent already exists and is just brought to the front, the new Intent's data won't be passed to it by default. You can override onNewIntent(Intent) in order to get around that:

@Override
protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);
    setIntent(intent); // Set the new Intent's data to be the currently passed arguments
}

Post a Comment for "Intent Extras Not Received"