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.

@App in @EBean is Null #481

@cyzgbw

Description

@cyzgbw

I used an @app in @ebean,but it's Null.
I read the code:

public static HttpUtil_ getInstance_(Context context) {
if (instance_ == null) {
instance_ = new HttpUtil_(context.getApplicationContext());//here used activity's application
}
return instance_;
}

private HttpUtil_(Context context) {
context_ = context;
init_();
}

private void init_() {
if (context_ instanceof Activity) {//but here,the context is application,not activity. so the application is null;
Activity activity = ((Activity) context_);
application = ((SoApplication) activity.getApplication());
}
loginInfo = new LoginInfo_(context_);
}

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