I have a function drawImage(json, check)
in file test.js. ow I want to call this function from android code. I use cwv.loadUrl("javascript:test.drawImage("+jsonArray+","+ true+")");
, but this solution doesn't work. How can I call this method from android code?
Asked
Active
Viewed 126 times
-1

edi233
- 3,511
- 13
- 56
- 97
-
http://stackoverflow.com/a/7544818/1276374 – Boris Mocialov Aug 07 '13 at 06:54
1 Answers
1
You can put you JS function not in external file. Insted of it put it in your html file like this:
<script>
function drawImage ()
{
// your computataion
}
</script>
// or connect your js functions from external file
<script src="test.js"></script>
And then call it from code
cwv.loadUrl("javascript:drawImage('"+jsonArray+"','"+ true+"')");
And pay attention to single quotation!
And the second mothod was described by Mocialov Boris.

Sergey Brazhnik
- 661
- 4
- 13
-
I must have this method in external file. Can you tell me how can I do that in that way? – edi233 Aug 07 '13 at 07:04
-