Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

set preference value android

boolean committed = PreferenceManager.getDefaultSharedPreferences(yourContext).edit().putBoolean(key, mValue).commit();
//you can also use putInt, putFloat, putLong, putString, putStringSet and change the value of mValue
//committed is true if everything went alright, false if there was an error
 
PREVIOUS NEXT
Tagged: #set #preference #android
ADD COMMENT
Topic
Name
1+6 =