[mono-android] Sending object between activities

Stuart Lodge me at slodge.com
Fri Jun 1 13:01:44 UTC 2012


If you can use serialization to achieve this, then that's a good way.

If you instead choose to use a singleton or some other "in memory"
solution, then please be aware of the Activity lifecycle -
http://docs.xamarin.com/android/tutorials/Activity_Lifecycle - please
consider that the Android OS is free to evict your app from memory and to
reinstate it again later - in which case the singleton might not always be
in RAM when your activity starts.

Stuart

On 31 May 2012 13:34, blorecrafter <blorecrafter at gmail.com> wrote:

> Hi
> You can use json serialization and attach the resulting string as Intent
> Extras. For this you need to decorate the Class you want to serialize with
> [DataContract] attribute and Class Fields with [DataMember].
> On the receiving activity you can again use json deserialization to
> construct the object.
>
>
> --
> View this message in context:
> http://mono-for-android.1047100.n5.nabble.com/Sending-object-between-activities-tp5710109p5710111.html
> Sent from the Mono for Android mailing list archive at Nabble.com.
> _______________________________________________
> Monodroid mailing list
> Monodroid at lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/monodroid/attachments/20120601/408f5d04/attachment.html>


More information about the Monodroid mailing list