Shared Preferences commit() calls (Android)
Shared Preferences commit() is synchronous, you should avoid calling it from your main thread because it could pause your UI rendering.
As a replacement, you can use apply() which changes the in-memory SharedPreferences object immediately but writes the updates to disk asynchronously.
![Screen Shot 2022-08-25 at 16.02.43.png 900](https://files.readme.io/7c76af4-Screen_Shot_2022-08-25_at_16.02.43.png)
Updated almost 2 years ago