프로그래밍언어/C#

xamarin 값 저장

부산딸랑이 2014. 8. 24. 12:03

protected void retrieveset()
{
//retreive
var prefs = Application.Context.GetSharedPreferences("MyApp", FileCreationMode.Private);
var somePref = prefs.GetString("PrefName", null);

//Show a toast
RunOnUiThread(() => Toast.MakeText(this, somePref, ToastLength.Long).Show());

}
protected void saveset(){

//store
var prefs = Application.Context.GetSharedPreferences("MyApp", FileCreationMode.Private);
var prefEditor = prefs.Edit();
prefEditor.PutString("PrefName", "Some value");
prefEditor.Commit();

}

'프로그래밍언어 > C#' 카테고리의 다른 글

C#용 httppost함수  (0) 2014.08.24
Xamarin Toast메세지  (0) 2014.08.24
C# 소켓통신  (0) 2014.06.16
listview   (0) 2014.06.12
thread  (0) 2014.06.10