I have an Android WebView that has JavaScript that is calling Android methods through the addJavascriptInterface method:
myWebview.addJavascriptInterface(new JavascriptBridge(), "Android");
public class JavascriptBridge {
public String getAString() {
return "my_str";
}
}
This works fine. I want to return a list of ints to the WebView. Tried this:
public class JavascriptBridge {
public int[] getMyInts() {
return new int[]{1,2,3};
}
}
but calling this function in JS returns undefined:
var myInts = Android.getMyInts();
Is there a list of valid return types for an Android Javascript Interface? Is it only primitives?