On Sep 15, 2011, at 2:59 AM, moelski wrote:
> In Activity 1 I tried this: 
>                        var intent = new Intent(this.BaseContext, new 
> HelloTabWidget().Class);
>                        intent.AddFlags(ActivityFlags.NewTask);
> 
>                        Bundle bun = new Bundle();
>                        *bun.PutSerializable("test", (BaseData)dat);  *
> 
>                        intent.PutExtras(bun);
>                        StartActivity(intent);
> 
> The bold line won´t work

PutSerializable() wants a Java.IO.ISerializable, which (1) BaseData doesn't 
implement, and  (2) you can't currently implement from managed code anyway. 
(java.io.Serializable requires that you implement private readObject() and 
writeObject() methods, which you can't currently do in Mono for Android.)

Thus, there are two workarounds:

 1. If Activity2 is in your process, store the BaseData object reference in a 
global variable somewhere and just read it from Activity2.
 2. If Activity2 isn't in your process (or using globals is "evil"), then 
serialize BaseData to a string (XML?) and send the string to Activity2.

 - Jon

_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to