I need to store some information at login that is available throughout the other activities in the app. I've tried creating a separate class as such:
public class MyApp : Application
{
private string siteID;
public string getSite()
{
return siteID;
}
public void setSite(string s)
{
siteID = s;
}
}
Setting site ID in my login activity:
MyApp ma = new MyApp();
ma.setSite("IT-TEST");
And then trying to get the value again later in another activity:
MyApp ma = new MyApp();
var site = ma.getSite();
Toast.MakeText(this, site, ToastLength.Long)
.Show();
But this part always returns blank. What am I missing?