louiscad
02/10/2018, 3:21 PMonCreate(…)
would be a suspend fun
so I can right away use withContext(IO)
for things like SharedPreferences access, but should I? Should I use coroutines everywhere so whenever I need to access even small things in storage that may be cached in memory, I can just do it in a non UI thread coroutineContext and suspend when I can?elizarov
02/10/2018, 4:13 PMstreetsofboston
02/10/2018, 5:05 PMcommit
on the SharedPreferences.Editor
.louiscad
02/10/2018, 5:11 PMstreetsofboston
02/10/2018, 5:41 PMapply
will write them on a background thread.
If they are loaded on first access, it seems to be very fast... I've never experienced an issue with it :)louiscad
02/10/2018, 6:46 PM