I've got a few custom objects like RootObject
and Form
that I want to pass on to the next activity.
This is an example of RootObject
:
public class RootObject
{
public Form Form { get; set; }
}
But how can I pass RootObject
to the next activity with an Intent
and get it in the next Activity
? In Form
there are again multiple properties with Lists
and stuff and I need to access some of the properties in my next Activity
. My intent is called like this:
saveButton.Click += delegate {
if(ValidateScreen()){
SaveData();
Intent intent = new Intent(this, typeof(MainActivity));
Bundle b = new Bundle();
b.PutSerializable("RootObject", RootObject);
StartActivity(intent);
}
};
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…