Doesn't it supposed to retain the loaded items?
That is your job, not the adapter's. Adapters do not "retain" "items", regardless of whether EndlessAdapter
is involved or not.
By default, activities are destroyed and recreated when the device undergoes a configuration change, such as a screen rotation. You need to arrange to hang onto your model data when this occurs, by:
- using
setRetainInstance()
on a dynamic fragment, or
- using
onSaveInstanceState()
, or
- using
onRetainNonConfigurationInstance()
, or
- in the worst case, using
android:configChanges
, as suggested in another answer