July 2018
Intermediate to advanced
242 pages
8h 6m
English
We are using the edit() extension function provided by the KTX library for the SharedPreferences class. It takes the lambda block, including the operations we want to perform on the SharedPreferences.Editor instance, and automatically invokes the SharedPreferences.Editor.apply() function to submit the transaction. The lambda block passed to the edit() function implements the type, SharedPreferences.Editor.() -> Unit, which allows us to access an instance of Editor through the implicit this modifier.
Read now
Unlock full access