realm-java icon indicating copy to clipboard operation
realm-java copied to clipboard

Realm doesn't auto-refresh immediately

Open dotgc opened this issue 11 years ago • 2 comments

I have an activity where I make an api call to load a JSONArray and show it on the UI using a RealmBaseAdapter with automaticUpdate set to true. I add stuff to the Realm in the onSuccess callback of the api request using a handler thread.

My issue is that the UI is not automatically updated for a while after committing the transaction. How do I make it work?

dotgc avatar Jan 05 '15 22:01 dotgc

Without more info and code it is hard to say. From you description it sounds like it happens eventually? How long after?

It could indicate that something in your UI is not updating itself properly when notifyDatasetChanged() is called.

One place to start could be by adding your own RealmChangedListener and checking that it gets called immediately after committing your transaction.

cmelchior avatar Jan 06 '15 06:01 cmelchior

Hi @ImGauravC I assume you figured this out? It not, please fill free to reopen.

cmelchior avatar Jan 09 '15 06:01 cmelchior