Skip to content Skip to sidebar Skip to footer

Android How To Save Realm Results With Onsaveinstancestate For Screen Rotation

My problem is this: When i open dialog fragment, i send realm and realm results from activity to dialog fragment. I always send different realm results to dialog fragment, dependin

Solution 1:

RealmResults<T> represents the query results you obtain from the Realm instance.

Realm is a database. It stores things. It's a persistence solution.

If there is something in the Realm, then that means you don't have to persist it in onSaveInstanceState(), because it's already in the Realm file.

You should just recreate the RealmResults<T> with the same sort parameter and you should be fine.

Also, seek your bug in whatever calls setChangeNoteListener and doesn't initialize the RealmResults.

Post a Comment for "Android How To Save Realm Results With Onsaveinstancestate For Screen Rotation"