I'm creating an Android application in Xamarin with C#. I've got one activity that is called every time a button is clicked. The content changes as it should do but every time the activity is reloaded my custom List
is empty again. I want it to keep its values so I can access them on the second screen.
This is my list:
public List<Screen> ListScreens;
This is how the Activity
is called:
saveButton.Click += delegate {
if(ValidateScreen()){
SaveData();
Intent intent = new Intent(this, typeof(MainActivity));
intent.PutExtra("CurrentScreenId", CurrentScreenId + 1);
StartActivity(intent);
}
};
Do I have to pass the List
with the intent or is there any other way to access it in every activity?