Skip to content

FirebaseUI 3: Adapter items reload, although there is no change in the data #947

Open
@NikiFoD

Description

@NikiFoD

I posted this on stackoverflow, but I think its better addressed here.

In FirebaseUI 3 release, I am creating an adapter within my activity using:

.setLifecycleOwner(this)

This starts and stops listening on onStart() and onStop() of my activity. The problem is that the items in the adapter reload even when there is no change in the data, cause onBindViewHolder is called every time the listener starts listening.

So for example, if I just put the app in the background and back in foreground, all items are reloaded (blinking screen). It also messes up with the shared element transition, cause when I return from the DetailsActivity to the MasterActivity, the adapter is reloading the data and the transition is not smooth.

In FirebaseUI 2.x.x release I didn't have this problem (populateViewHolder wasn't called unless there was a change in the data).

Is there a way, other than start listening in onCreate and stop listening in onDestroy to overcome this problem?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions