up vote 0 down vote favorite
share [fb]

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!

link|improve this question

Need some more context. Where does the Javascript live? This is tagged Android. So is this a WebView embedded in your activity? – Thilo Aug 2 at 9:53
I believe you are searching for something like this : stackoverflow.com/questions/4325639/… – Rudy Aug 2 at 9:53
feedback

2 Answers

up vote 2 down vote accepted

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.