0

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!

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

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.