[mono-android] SPAM-LOW: Passing a class between classes
Karl Heinz Brehme Arredondo
karl at e-magesolutions.com
Mon Nov 21 16:00:11 EST 2011
Ooops The above below things are just loud self thought
From: Karl Heinz Brehme Arredondo <karl at e-magesolutions.com>
Reply-To: "monodroid at lists.ximian.com" <monodroid at lists.ximian.com>
Date: Mon, 21 Nov 2011 18:38:53 -0200
To: <paul at all-the-johnsons.co.uk>
Cc: "monodroid at lists.ximian.com" <monodroid at lists.ximian.com>
Subject: Re: [mono-android] SPAM-LOW: Passing a class between classes
Hi Paul,
The above things are just loud self thought
I'm not doing a real thing yet on Monodroid just on MonoTouch that I think
it's possible but on my old android tests:
OnCreate is like Form1_Load on Windows, so the event than run after the
initialization and constructor of the form class.
As the form class is Results, you can create a constructor there, I don't
remember why (maybe Monodroid template) but my project has:
public FormMain()
{
}
public FormMain (IntPtr handle) : base(handle)
{
}
I would say that in theory you can create a new on like
public FormMain(YourClass yourClass)
{
this.yourClass = yourClass;
}
And on OnCreate you can use the value of this.yourClass.
But looking for how I called the new activity I found this awful thing:
Intent formMain = new Intent(Program.context, typeof(FormMain));
StartActivity(formMain);
So different that Windows and MonoTouch, my new formMain isn't an instance
of the new form/activity/view it's another thing and Intent Now I bacame
lost hehe because on iOS I have Forms, TextBoxes and ComboBoxes using the
native ones overrided. And I'm getting close to do this in Android too but
now I think I must start over with my UI tests, sorry. I became lost now.
Maybe the is a way to call a new intent using a real activity instantiated
(so possible of pass a parameter).
But, you can make this parameter class static on "main" class of the
application and use it everywhere (like User.ID, User.Password, etc).
Karl
_______________________________________________ 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/20111121/bb27f391/attachment.html
More information about the Monodroid
mailing list