I'm creating Intent
, and put a PendingIntent
into it's extras.
PendingIntent pending = PendingIntent.getService(...);
Intent intent = new Intent(context, MyService.class);
intent.putExtra("foo", pending);
Looks fine, because PendingIntent
implements Parcellable
. No documentation says I cannot do that.
But when I try to get it in my service, I get:
Parcel android.os.Parcel@ab33c24: Unmarshalling unknown type code 6619252 at offset 208
Is it fixable, or I should avoid putting PendingIntent into Bundle?
Android version: 6.0.1.
UPDATE: I need it to cancel previously created PendingIntent-s:
locationManager.cancel(updateListenerPendingIntent);
alarmManager.cancel(someAlarmPendingIntent);