-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
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.
- 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.
- 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
Labels
No labels