Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why not use commit() to save something rather than use apply()? #1

Closed
okadaNana opened this issue May 11, 2016 · 1 comment
Closed
Labels

Comments

@okadaNana
Copy link

No description provided.

@GrenderG
Copy link
Owner

Unlike commit(), which writes its preferences out to persistent storage synchronously, apply() commits its changes to the in-memory SharedPreferences immediately but starts an asynchronous commit to disk and you won't be notified of any failures.

apply() was added in 2.3 and it's faster than commit() due to asynchrony.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants