From 54c748fb290180499341eca5dd114ba15de26d8c Mon Sep 17 00:00:00 2001 From: esensar Date: Sat, 7 Jan 2017 17:24:43 +0100 Subject: [PATCH] Copy users from realm --- .../java/com/smarthomies/realtimetalk/database/UserDAO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/smarthomies/realtimetalk/database/UserDAO.java b/app/src/main/java/com/smarthomies/realtimetalk/database/UserDAO.java index 35de193..0626d76 100644 --- a/app/src/main/java/com/smarthomies/realtimetalk/database/UserDAO.java +++ b/app/src/main/java/com/smarthomies/realtimetalk/database/UserDAO.java @@ -15,7 +15,7 @@ public class UserDAO extends RealmDAO { } public User findUserById(Realm realm, int id) { - return realm.where(entityClass).equalTo(User.PRIMARY_KEY, id).findFirst(); + return realm.copyFromRealm(realm.where(entityClass).equalTo(User.PRIMARY_KEY, id).findFirst()); } public void deleteById(Realm realm, int id) {