Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FLAG_ACTIVITY_NEW_TASK flag 怎么添加 #76

Open
iblue007 opened this issue Feb 26, 2020 · 1 comment
Open

FLAG_ACTIVITY_NEW_TASK flag 怎么添加 #76

iblue007 opened this issue Feb 26, 2020 · 1 comment

Comments

@iblue007
Copy link

iblue007 commented Feb 26, 2020

Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?

跳转的时候只能传递bundle,没办法设置FLAG_ACTIVITY_NEW_TASK ,这个要怎么解决?

@iblue007
Copy link
Author

解决方案:
IntentDecor intentDecor = new IntentDecor() {
@OverRide
public void decor(IComponentRouter.IntentDecorDelegate delegate) {
delegate.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
};
List intentDecorList = new ArrayList<>();
intentDecorList.add(intentDecor);
UIRouter.getInstance().openUri(context, url, bundle, intentDecorList);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant