android - What's the difference between commit() and apply() in Shared Preference -


i using shared preference in android app. using both commit() , apply() method shared preference. when use avd 2.3 shows no error, when run code in avd 2.1, apply() method shows error. what's difference between these two? , using commit() can store preference value without problem?

apply() added in 2.3, commits without returning boolean indicating success or failure.

commit() returns true if save works, false otherwise.

apply() added android dev team noticed no 1 took notice of return value, apply faster asynchronous.

http://developer.android.com/reference/android/content/sharedpreferences.editor.html#apply()


Comments

Popular posts from this blog

Cursor error with postgresql, pgpool and php -

delphi - ESC/P programming! -

c++ - error: use of deleted function -