Hello Android Developers.

I have a question and would like to understand it in depth.
I know that to interact from Javascript to Java you have to inject a Java 
object using the addjavascriptInterface method in webview.

Here is the problem I am facing.

1. I register a java object using AddJavascriptInterface method to be 
available in my JS.

2. I inject few JS in the webview using webview.loadURL("javascript:XXX");

3. I send a JS event when I am done with injecting the JS.

The problem is that if *immediately* after step 1, if i execute the 
following Javascript 

    mWebView.loadUrl("javascript:if(window.myobject) 
console.log('myobject found---------'); else {console.log('myobject not 
found----');}");

I get *"myobject not found"  * in my console's log.

I want to know that if there is some time before i can access my object and 
if so, how do i get to know how much time should i wait to call my object?


-Akshat

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to