We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3637787 commit 8af558fCopy full SHA for 8af558f
src/com/scottagarman/android/jsexample/JsExampleMain.java
@@ -22,14 +22,16 @@ public void onCreate(Bundle savedInstanceState) {
22
wv.getSettings().setJavaScriptEnabled(true);
23
24
//add interface
25
- wv.addJavascriptInterface(jsInterface, "android");
+ wv.addJavascriptInterface(jsInterface, "android");//android is the keyword that will be exposed in js
26
27
//load file
28
wv.loadUrl("file:///android_asset/test.html");
29
}
30
31
- //interface
+ //javascript interface
32
private class JsInterface{
33
+ //function that will be called from assets/test.js
34
+ //js example: android.log('my message');
35
public void log(String msg){
36
Log.d("MSG FROM JAVASCRIPT", msg);
37
0 commit comments