[mono-android] Being driven insane....
nodoid
paul at all-the-johnsons.co.uk
Mon Nov 28 09:01:23 EST 2011
Hi,
Hmm, something is still not right. Are there any types which cannot be
serialized for Android?
Currently, I have this
[Serializable()]
public class common
{
public int p, a, w, pa;
public double bodyWeight, tempBody, tempSurround;
public double[,] correctionData = new double[3, 20];
public double[,] iterations = new double[3, 20];
public double c, b, cas;
public string s;
}
and to serialize in the main tab creator
[Activity(MainLauncher = true, Label = "@string/ApplicationName", Theme
= "@android:style/Theme.NoTitleBar")]
public class AndroidTimeOfDeath : TabActivity
{
protected override void OnCreate(Bundle bundle)
{
common data = new common();
base.OnCreate(bundle);
SetContentView(Resource.Layout.Main);
TabHost.TabSpec spec;
Intent intent;
intent = new Intent(this, typeof(TimeTemp));
intent.AddFlags(ActivityFlags.NewTask);
XmlSerializer x = new XmlSerializer(data.GetType());
StringWriter o = new
StringWriter(System.Globalization.CultureInfo.InvariantCulture);
x.Serialize(o, data);
// etc
}
The Serialize crashes and burns with a System.ArgumentException
I'm trying to figure out why this is happening and wonder if there are any
types that cannot be serialized. From a search, in standard C# Arrays of
ArrayList and certain generics can't be handled. Does Android add anything
additional to these?
I have changed the [Serializable] to [Serializable()] as well as commenting
it out and that makes no difference. The data.GetType() I have also tried as
typeof(common). Still crashes and burns.
Thanks
Paul
--
View this message in context: http://mono-for-android.1047100.n5.nabble.com/Being-driven-insane-tp5016975p5028935.html
Sent from the Mono for Android mailing list archive at Nabble.com.
More information about the Monodroid
mailing list