Catch Exception in JavaScript

by kevin » Wed, 08 Apr 2009 19:47:38 GMT


Sponsored Links
 My application uses WebView to load javascript which calls into Java
class (through webview javascript iterface). Can the JavaScript catch
exceptions thrown from Java? This is very important for the
application, any help is appreciated.

Thanks
Kevin
--~--~---------~--~----~------------~-------~--~----~



Catch Exception in JavaScript

by kevin » Thu, 09 Apr 2009 11:35:48 GMT


 Anyone can help on this? I tried to catch exception in javascript but
doesn't work, is it because webview not support javascript exception
handling?

Thanks,
Kevin



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Catch Exception in JavaScript

by Mattaku Betsujin » Thu, 09 Apr 2009 11:43:57 GMT


 I think the answer is no. If java JavaScript calls Java, and the Java method
throws an uncaught exception, it kills the app process.

Your best bet is to put a try-catch block around every Java method that can
be called by Javascript.

Just curious. What kind of exception are you expecting? I have written quite
a bit of JavaScript -> java calls in my app and this has never been an issue
for me.
2009/4/8 kevin <kevin_x...@yahoo.com>



--~--~---------~--~----~------------~-------~--~----~



Catch Exception in JavaScript

by kevin » Tue, 14 Apr 2009 09:56:08 GMT


 My javascript calls Java to do IO operation, I was trying to catch
IOException inside javascript.

Kevin




--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. thread questions.

Hi,
    I have a question.
    If I  have a list which has many url links. I want to download all
url. How should I do? There are two solutions:
   1) use only one thread to download all links. It needs a while
loop. for example,
       int i=0;
       while(i<list.length){
           download(list[i]);
           i++;
       }

   2) create a thread for a link. After the link is downloaded, create
a new thread to next link. Is it good idea?

   Please give me your suggestions. thanks.
--~--~---------~--~----~------------~-------~--~----~

2. no avd available while

I have configured android with eclipse and i am able to write code but
when i try to run application it tell that "No AVD avaiable" in
android device chooser. What could be wrong in it ?


hope some quick reply
--~--~---------~--~----~------------~-------~--~----~

3. How to debug android framework with eclipse and emulator

4. How to debug android framework with eclipse and emulator

5. How to debug android framework with eclipse and emulator

6. How to draw a circle ?

7. Play native shutter sound