Experiencing a frustrating issue with my application that involves a WebView and a html-page with JavaScript functions. Occasionally, the JavaScript functions fail to execute randomly. Despite spending the entire day trying to debug this issue, I can only replicate it on a physical device (HTC Legend) and not on an emulator.
Essentially, I am utilizing callbacks to communicate with JavaScript whenever a user interacts with a button. These callbacks trigger JavaScript functions to redraw the html content.
mHandler.post(new Runnable() {
public void run() {
mWebView.loadUrl("javascript:getDataLine()");
}
});
The first line of the JavaScript code generates an alert to indicate that it has begun execution, allowing me to monitor its progress.
Adding alerts or console.log statements throughout the code has not provided any resolution, suggesting that the issue lies within the WebView component or Android itself. I am in need of a method to monitor the background processes to identify if any previous call might have failed and caused a thread to stall.