閉じる

Coroutine周りで Realmが java.lang.IllegalStateException: Realm access from incorrect thread. Realm objects can only be accessed on the thread they were created.と落ちる。

メッセージの通り「Realmオブジェクトは作られたのと同じスレッドから出ないとアクセスできないよ」ということなのだけど、自分的には同一スレッドでアクセスしているつもりだったのだけど、コルーチン周りが絡むと簡単にはいかない…