I have the following javascript code:
function mine()
{
var i = 3;
AndroidObject.call();
}
where AndroidObject is javascript interface to java. It has method call
WebView myWebView;
public void call()
{
runOnUiThread(new Runnable()
{
@Override
public void run()
{
myWebView.loadUrl('javascript:alert(i);');
}
});
}
The following code will produce error while execution " i is not defined " in javascript, since javascript will be executed not in the context where java code was called from.
Is it possible to execute JS from java method in the same context, i.e. to make "i" visible in the case above?
"i" is integer in this example, but it may be object of ANY type.
Thanks.