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

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -