반응형
참고 글: PreferenceActivity 사용하기
저장할때:
SharedPreferences myPref = getSharedPreferences("some_name", Activity.MODE_PRIVATE);
SharedPreferences.Editor editor = myPref.edit();
editor.putInt("lastThemePosition", m_Fgallery.getSelectedItemPosition());
editor.commit();
읽을때:
SharedPreferences settings = getSharedPreferences("some_name", Activity.MODE_PRIVATE);
int lastThemePosition = settings.getInt("lastThemePosition", 0);
저장할때:
SharedPreferences myPref = getSharedPreferences("some_name", Activity.MODE_PRIVATE);
SharedPreferences.Editor editor = myPref.edit();
editor.putInt("lastThemePosition", m_Fgallery.getSelectedItemPosition());
editor.commit();
읽을때:
SharedPreferences settings = getSharedPreferences("some_name", Activity.MODE_PRIVATE);
int lastThemePosition = settings.getInt("lastThemePosition", 0);
반응형
'개발 > 안드로이드 App' 카테고리의 다른 글
앱에서 안드로이드 마켓/티스토어 연결하는 법. (0) | 2012.02.10 |
---|---|
패키지명 변경시 check list. (0) | 2012.01.29 |
[TIP] Activity (0) | 2011.11.09 |
GalleryView 옵션 (0) | 2011.07.14 |
EditView 관련 정리 (0) | 2011.07.11 |