Skip to content

Destroying custom scoped module #238

@sergejsha

Description

@sergejsha

I have following use-case. I create a custom scope (@PerActivity) which creates a single module per Android Activity. Some instances in this module are initialized with Activity instance and has to be bound to Activity lifecycle. Particularly they have to receive onDestroy() call, when Activity gets destroyed.

Would it be possible to call some kind of close() or destroy() methods on the module that it forwards this call to all created instances interested in such a callback?

If not, is there Dagger2 API allowing me to write an extension doing this? Thanks!

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