SPG
SPG

Reputation: 6197

Android: share java data with javascript?

I hava a programme contains java and javascript(webview). Now, in java

String vi = "I am a student";

In javascript

var fromvi;

How can I get the value in java String "vi" and set this value into javascript var "fromvi"? Thanks!

Upvotes: 0

Views: 306

Answers (1)

Paddy
Paddy

Reputation: 2873

AddJavascriptInterface will allow you to bind a Java object to a WebView and control it with Javascript.

Upvotes: 2

Related Questions