JavaScript on Android randomly stops working

Posted by AndersWid on Stack Overflow See other posts from Stack Overflow or by AndersWid
Published on 2010-05-03T16:38:38Z Indexed on 2010/05/03 22:18 UTC
Read the original article Hit count: 248

Filed under:
|
|
|

Hi!

I have an application that uses a WebView and a html-page with javascript functions. Randomly the JavaScript functions doesn't seem to be called. It works up to a random point (I have looked at this bug all day) can only be produced on hardware (HTC Legend) not on emulator.

Basicly I'm using callback to javaScript whenever the user presses a button, these callbacks tell the html to redraw using javaScript functions.

mHandler.post(new Runnable() { public void run() { mWebView.loadUrl("javascript:getDataLine()"); } });

The first line in this javaScript code is an alert that says that it has started, so that I can see that it's working.

Settings alerts or console.log's everywhere won't help as it seems the problem is in the webview or in Android itself. I need a way to see what's going on in the background. Maybe see if a previous call failed and stalled the thread or something.

© Stack Overflow or respective owner

Related posts about android

Related posts about webview