-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Flutter页面启动 Activity页面,如何拿到参数? #18
Comments
安卓会把参数拼接在url尾部 |
@nightwolf-chen Android实际测试发现并没有拼在url尾部 |
我们在实现的过程中在路由层将url参数进行了拼接。所以建议你自己实现一个路由层,处理参数传递。 |
@nightwolf-chen |
这里是有点不合理,我们后面会重新考虑这个问题。如果你有好的修复欢迎提pull request。 |
======
} 可见,带给page的参数必须是放在query字段下的一个map |
Android 需要在外面包一层 |
原生的activty怎么取这个params? |
会自动拼接到startActivity url的query参数中 |
flutter中openPage中params 必须类似于{"query":{"present":true}} 这样Activity中就能在url中解析 |
Flutter页面代码:
FlutterBoost.singleton.openPage("pagename", {"key":"value"});
Android代码
FlutterBoostPlugin.init(new IPlatform() { ........... /** * start a new activity from flutter page, you may need a activity router. */ @Override public boolean startActivity(Context context, String url, int requestCode) { return PageRouter.openPageByUrl(context, url, requestCode); } .......... });
Flutter启动Android Activity,请问下Android代码 startActivity(Context context, String url, int requestCode)怎么拿到Flutter中传过来的参数key,value????
The text was updated successfully, but these errors were encountered: