The combination of custom Parcelable and PendingIntent is more likely iffy - but, no matter how lucky, Intent is Parcelable , why not just pass the Intent that you received as an extra for Intent you wrap it in PendingIntent - do you allow Activity or Service to do the processing?
Edit : as stated in this answer from CW.
Edit : Example
Your ReceiverAlarm class will work "kind of like":
public class ReceiverAlarm extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); Intent intentNotif = new Intent(context, NotificationViewer.class); intentNotif.putExtra("intent", intent); PendingIntent contentIntent = PendingIntent.getActivity(context, 0, intentNotif, 0); Notification notification = new Notification(icon, text, when); notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent); notificationManager.notify(NOTIFICATION_ID, notification); } }
And in NotificationViewer :
public class NotificationViewer extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main);
source share