Hi @all,
I try to send a data class to another activity. First this is my (at the
moment really simple) data class:
[Serializable]
class BaseData
{
public string test { get; set; }
}
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 ... And
bun.PutSerializable("test", (ISerializable)dat);
results in an error.
So how can I send a dataClass from one activity to another?
And how can I deserialize the data in Activity2?
I tried something like this:
var dat = (BaseData)this.Intent.GetSerializableExtra("test");
But since the sending in Activity 1 not work I have no chance to test the
getting in Activity 2 ...
Any help would be great!
Dominik
--
View this message in context:
http://mono-for-android.1047100.n5.nabble.com/How-to-send-a-custom-Data-Class-to-next-Activity-tp4805844p4805844.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid