Closed russhwolf closed 4 years ago
I'm fine with apply()
no need for commit
how about something like a simple
commit(async = true)
Currently there's no common editor abstraction since Android is the only platform for which that exists. So there's nowhere to put a call like commit(async = true)
.
This is a feature we would like to have, we use the Settings object to set the environment in our apps, and then immediately restart the app using ProcessPhoenix. Because apply()
is used, and the process is killed, the changes are not saved.
Thanks for confirming a use-case. I'll merge the PR and look at doing a release this weekend.
Published 0.6.3 including this update
The Android
SharedPreferences
interface has two methods to commit changes when editing.apply()
is the recommended default and is whatAndroidSettings
does currently, but some users might prefer the synchronouscommit()
instead. I'd like to verify that there is demand for this, and if so add a configuration option to usecommit()
instead. Probably this is a constructor argument, but other suggestions are welcome.