Intent Extras Being Lost When Sending With Pendingintent For Gcm
I am creating a notification but when sending it using PendingIntent the extras get lost in the process. I am using a singleTop Activity, so I set a break point at the onNewIntent
Solution 1:
You may want to use putStringArrayListExtra
to add ArrayList to the bundle.
In your case:
intent.putStringArrayListExtra(GlobalVars.KEY_EVENT, events);
and then use getStringArrayListExtra
to retrieve data.
More info here (search for putStringArrayListExtra
)
Solution 2:
This is because Intent.putExtra(String key, <Whatever> value)
doesn't accept ArrayList as a value. Your code goes past compiler because ArrayList is Serializable, it is accepted but with ArrayList something else is wrong.
You should use [putStringArrayListExtra()][1]
Post a Comment for "Intent Extras Being Lost When Sending With Pendingintent For Gcm"