android - How to set value in SharedPreferences as standard? -
i know how set , value in shared preferences:
but works while app started.
i wonder how can set values standard set starting app first time. not code setting them, instead writing in strings.xml.
is possible?
where sdk root? check samples on shared prefs....
$sdk_home/samples/$platform/apidemos/src/com/example/android/apis/preference/defaultvalues.java
is sample u want.
example in main_activity.oncreate():
preferencemanager.setdefaultvalues(this, r.xml.your-defaults, false); ... preferencemanager.getdefaultsharedpreferences(this).getstring("default_user_oid", "default").equalsignorecase("default")
android sharedpreferences
No comments:
Post a Comment