Android: Intent extras not received

If you have put extras to an intent and they are not received at the receiving activity, there could be 2 reasons..

1. The activity already exists in android backstack and the extras are not caught in onCreate() but they can be found in onNewIntent()

2. If the extras are passed with an activity of a PendingIntent, then as per the official documentation. So, to pass the extras correctly, either you need to make sure each of the intents are having differentiation in terms of action, data, type, class, and categories. Or cancel the current PendingIntent if exists in the system by using FLAG_CANCEL_CURRENT or FLAG_UPDATE_CURRENT.

Happy Coding..


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s