Reputation: 5417
i want to populate a List in an HTML5 File (displayed within a WebView) with data from Android Code (for exmaple from an ArrayList). Can anyone please tell me how or if this is possible.
Thanks in advance Thommy
Upvotes: 0
Views: 470
Reputation: 2572
Read this:
http://developer.android.com/guide/webapps/webview.html#BindingJavaScript
You can expose anything from your Android code. If you return some JSON (array or object), you can build your list (or anything else) using some javascript.
Upvotes: 1
Reputation: 1558
With a WebView you can simply:
webview.loadUrl("javascript:YOURJAVASCRIPTCODE");
Your javascript code could be something like:
document.getElementById('txtField1').value = "test";
Upvotes: 1