Is it ok to write to Realm on the main thread?
Basically I'd like to write some ObjectA
to Realm right before starting ActivityA
.
Once ActivityA
starts it needs immediate access (in onCreate
) to ObjectA
- can I also read on the main thread?
Basically this ObjectA
is too large to pass through the bundle so I need to store it in a cache.
I was initially thinking of storing the object in an in-mem cache and then storing it in Realm after the activity starts, but was wondering if I could skip having to write my own in-mem cache.