Realm realm; private final LiveRealmObject<Person> livePerson; public ExampleViewModel() { realm = Realm.getDefaultInstance(); livePerson = new LiveRealmObject<>(realm.where(Person.class) .findAllSorted("name").first()); } public LiveRealmObject<Person> getPerson() { return livePerson; } @Override protected void onCleared() { realm.close(); super.onCleared(); } }