Search code examples
androidandroid-intentbroadcastreceiveralarmmanagerandroid-pendingintent

Sending Extras to onReceive only retrieves ALARM_COUNT


I made a custom view that sets an alarm with AlarmManager. I want to restore this view later so I'm trying to send the BroadcastReceiver several extras. The onReceive fails to retrieve anything but the ALARM_COUNT extra though.

I've looked for a while and count find a solution. I've tried PendingIntent.FLAG.UPDATE.CURRENT multiple flags with the intent itself but nothing works.

Is there a better way to restore a views state from a BroadcastReceiver?


Solution

  • "extras are all serialized into a byte stream in the Intent." I was improperly adding a custom object/class which caused the entire deserialization to fail.