일부 설정을 저장하려고하는데 모노 도이드가 다르게 보이는 것처럼 코드의 첫 번째 줄에 붙어 있기 때문에 내가 따르는 자습서 (Android 자습서)가 도움이되지 않습니까?모노 도이드로 개인 환경 설정을 저장하는 방법?
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();
모노 도이드에는 Activity.MODE.PRIVATE;
이 표시되지 않습니다.