HI, i have a problem i just create a simple app with one activity and on this activity i add two buttons and one edittext, on button saves data to the SharedPreferences and other read it, and display the data to the EditText, everything works fine until i add a splashscreen this is the splashscreen activity code
[Activity(MainLauncher = true, Theme = "@style/Theme.Splash", NoHistory = true)]
public class SplashScreen : Activity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Create your application here
StartActivity(typeof(Activity1));
}
}
and this the Activity1 code:
[Activity(Label = "Shared Preferences", Icon = "@drawable/icon")]
public class Activity1 : Activity
{
EditText dataEditText;
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.Main);
Button saveButton = FindViewById<Button>(Resource.Id.SaveSP);
Button readButton = FindViewById<Button>(Resource.Id.ReadSP);
dataEditText = FindViewById<EditText>(Resource.Id.DataEditText);
saveButton.Click += delegate
{
saveData();
};
readButton.Click += delegate
{
readData();
};
}
it works only if the app is running but as soon i stop it, and run it again, the values never get readed from the SharedPreferences.
any idea?