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.

@RootContext vs @App in an @EBean #397

Description

@dkunzler

When injecting a DEFAULT scoped Bean (D) in a SINGLETON scoped bean (S), the Context passed to D_.getinstance is already the Instance of the main Application.

Therefore injecting @App results in the Application object being null since the context instanceof Activity check fails.

There should be another if case where context instanceof MyApplication is checked to prevent this.

AndroidAnnotations Version is 2.7

Activity

  1. pyricau commented on Nov 17, 2012

    @pyricau
    Contributor

    There is no guarantee that the application context is the actual Application instance. See this Stack Overflow question.

    This issue is a duplicate of #228, and #352 should solve it.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions