我想保存一些設置,但我正在遵循的教程(android教程)沒有幫助,因爲我卡在代碼的第一行,因爲它似乎monodroid做它不同?如何使用monodroid保存個人偏好?
select your mode to be either private or public.
int mode= Activity.MODE.PRIVATE;
// get the sharedPreference of your context.
SharedPreference s mySharedPreferences ; mySharedPreferences=getSharedPreferences(「Name_of_your_preference」,mode);
// retrieve an editor to modify the shared preferences
SharedPreferences.Editor editor= mySharedPreferences.edit();
/* now store your primitive type values. In this case it is true, 1f and Hello! World */
editor.putBolean(「myBoolean」,true);
editor.putFloat(「myFloat」,1f);
editor.putString(「myString」,」 Hello! World」);
//save the changes that you made
editor.commit();
我沒有在monodroid中看到Activity.MODE.PRIVATE;
。