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

js 调用java #9

Closed
w2282346548 opened this issue Jun 14, 2017 · 1 comment
Closed

js 调用java #9

w2282346548 opened this issue Jun 14, 2017 · 1 comment

Comments

@w2282346548
Copy link

我看到代码中,java 调用js,可以使用quickCallJs();那么 js 调用java,需要在那里做设置呢

@Justson
Copy link
Owner

Justson commented Jun 14, 2017

//Android 端
mAgentWeb.getJsInterfaceHolder().addJavaObject("android",new AndroidInterface(mAgentWeb,this.getActivity()));

在 Js 里就能通过 window.android.callAndroid() 调用 Java 层的 AndroidInterface 类里 callAndroid 方法

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

2 participants