Realm-java: When App is closed getting error Callback cannot be delivered on current thread Realm cannot be automatically updated on a thread without a looper.

Created on 9 May 2018  Â·  5Comments  Â·  Source: realm/realm-java

I am trying to Add a record in Realm using insertOrUpdate when my App is closed(When my app receives a push notification through firebase) but I am getting the error.

Callback cannot be delivered on current thread. Realm cannot be automatically updated on a thread without a looper.

Most helpful comment

@Redhac The solution is don't use async transaction because as there is no looper attached.

All 5 comments

You're trying to add a change listener or call an async transaction with an onsuccess/onerror callback on a thread that does not have a looper

Yeah got the solution.

can you share your solution pls ?

@Redhac you have to not try to add a change listener or call an async transaction with onSuccess/onError callback on a thread that does not have a looper

@Redhac The solution is don't use async transaction because as there is no looper attached.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Merlin1993 picture Merlin1993  Â·  3Comments

yuwu picture yuwu  Â·  3Comments

mithrann picture mithrann  Â·  3Comments

wezley98 picture wezley98  Â·  3Comments

pawlo2102 picture pawlo2102  Â·  3Comments