1

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);
Dzmitry Lazerka
  • 1,809
  • 2
  • 21
  • 37
  • You don't need the original, you can recreate it with the same ID in order to cancel it, take a look at this: http://stackoverflow.com/questions/11681095/cancel-an-alarmmanager-pendingintent-in-another-pendingintent – Daniel Nugent Dec 20 '15 at 00:30
  • If the alternate solution in the other comment doesn't work for you, post the code that gets the PendingIntent from the intent in the service. I cannot reproduce the error running similar code on the 6.0 emulator. – Bob Snyder Dec 20 '15 at 05:17

0 Answers0