Hi guy's
I have an activity named sitting and it has options like checkboxes and save button , when I click save I put Finish() method to finish app , I want when go back to sitting activity I find the same options I set it when I clicked save ? how can I do that guy's
@omar.7226
Here how use Preferences ?
ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences(this);
ISharedPreferencesEditor editor = prefs.Edit();
editor.PutInt(("number_of_times_accessed", accessCount++);
editor.PutString("date_last_accessed", DateTime.Now.ToString("yyyy-MMM-dd"));
editor.Apply()
You can also use activity methods like.
https://developer.xamarin.com/guides/android/application_fundamentals/activity_lifecycle/Images/image2.png
Answers
@omar.7226 You can use preferences for save state of activity.
@Xnaina can you give me an example code ??
@omar.7226
Here how use Preferences ?
You can also use activity methods like.
https://developer.xamarin.com/guides/android/application_fundamentals/activity_lifecycle/Images/image2.png
@Xnaina thanks, I use SharedPreferences in tow methods and I call one method in OnResume() and the other method in OnPause()
it's work in one checkbox but, I have more than one checkbox