Skip to content

"your target activity haven't been started." when activity not started from AutoGo #5

@registernet

Description

@registernet

Hello @TellH , would you please check the below issue? Thanks very much.
When the activity is not started from AutoGo.from(xxx).gotoXXX().xxx.go();, there might be problems in the target activity's AutoGo.assign(this), as the autoAssigner may not be initialized yet.

  1. If the project is huge, it would take a lot of time to check every startActivity entry, any one entry left without using AutoGo....go() might get into trouble.
  2. If the activity is started outside, like from a push event, then there is no way to initialize the autoAssigner, it definitely will cause problems.
    So, it would be better to init the autoAssigner in the AutoGo.assign(this) method rather than AutoGo.gotoXXX(), one way of doing this is in the method AutoGo.getAssigner(Activity):

AutoAssigner autoAssigner = autoAssignerMap.get(className);
if(autoAssigner == null) {
autoAssigner = (AutoAssigner) Class.forName(className + "_AutoAssigner").newInstance();
autoAssignerMap.put(className, autoAssigner);
}

the second way of doing this is for users who are using the AutoGo lib:
when you call AutoGo.assign(this);
call AutoGo.from(this).gotoSelfActivityName(); before it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions