How to use Realm for Android like a champ, and how to tell if you’re doing it wrong
Gabor Varadi
2K28

Excellent article! I am definitely bookmarking this.

I wanted to point out another thing, which at first looks quite obvious but wasted my time. Basically if you’re new to Realm.

If you’re using executeTransactionAsync then make sure you’re using the Realm instance passed in the executemethod of the transaction. Like

`mRealm.executeTransactionAsync(new Transaction() {
 @Override
 public void execute(Realm bgRealm) {
 modifyUser(user, bgRealm);
 }
}, …..`

and *not* the one you opened in the UI thread (mRealm).