Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Clean up registered listeners #1865

Description

@programmerr47

Hi. Currently as I understand everything correctly we cleaning up views in onDestroyView method. Here was as I remember one of the latest discussion about this topic.

I agree with proposals, but could we enhance it a little bit? Currently we can hang listeners to views through bunch of annotations (for example @OnFocusChange). The question is: can we release those listeners (which we added by annotations) before cleaning up views?

Activity

  1. WonderCsabo commented on Nov 23, 2016

    @WonderCsabo
    Member

    We should definitely do this. However when we should cleanup in case of @EView(Group) and @EActivity. @dodgex wdyt?

  2. dodgex commented on Nov 23, 2016

    @dodgex
    Member

    Sounds like a good idea. But it looks like it might become a bit complicated

    from what i found from a short time of googling:

    • some listeners (e.g.) focus can be removed by calling setOnFocusChangeListener with null
      -but others (e.g.) text change listener work on a add/remove mechanic so we have to store the handler here
  3. WonderCsabo commented on Nov 23, 2016

    @WonderCsabo
    Member

    We have to add a new method to ListenerHandler, generateRemoveListener() or sg like this, and implement it in each listener. And yeah, we have to store the listeners in a field. :(

    It is a bigger task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions